<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts | Alex M. Chubaty</title><link>https://alexchubaty.com/posts/</link><atom:link href="https://alexchubaty.com/posts/index.xml" rel="self" type="application/rss+xml"/><description>Posts</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-ca</language><lastBuildDate>Wed, 08 Jan 2020 00:00:00 +0000</lastBuildDate><image><url>https://alexchubaty.com/media/icon.svg</url><title>Posts</title><link>https://alexchubaty.com/posts/</link></image><item><title>Using the latest GDAL with R packages on macOS - redux</title><link>https://alexchubaty.com/posts/2020-01-08-using-latest-gdal-macos-redux/</link><pubDate>Wed, 08 Jan 2020 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2020-01-08-using-latest-gdal-macos-redux/</guid><description>&lt;p&gt;As an update to an
, here&amp;rsquo;s how to use the latest versions of GDAL/PROJ with R spatial packages.&lt;/p&gt;
&lt;h2 id="install-gdal"&gt;Install GDAL&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install pkg-config
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install gdal
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="reinstall-r-spatial-packages"&gt;(Re)install R spatial packages&lt;/h2&gt;
&lt;p&gt;Next, we need to install a few packages from source in order to use the new GDAL libraries:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## (re)install spatial packages from source&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;install.packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;rgeos&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;sf&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;sp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;source&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## rgdal requires some additional configuration to build correctly:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## based on http://stackoverflow.com/a/26836125/1380598&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;install.packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;rgdal&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;source&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;configure.args&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;--with-proj-include=/usr/local/include&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;--with-proj-lib=/usr/local/lib&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rgdal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;## confirm the GDAL version being used&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Yes, The Queen is listed as an 'author' on our R packages</title><link>https://alexchubaty.com/posts/2017-09-14-queen-copyright/</link><pubDate>Thu, 14 Sep 2017 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2017-09-14-queen-copyright/</guid><description>&lt;blockquote class="twitter-tweet" data-lang="en"&gt;&lt;p lang="en" dir="ltr"&gt;Just noticed the Queen is listed as an author in this (and probably other) R packages &lt;a href="https://t.co/ehCb3uHjpx"&gt;https://t.co/ehCb3uHjpx&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/rstats?src=hash"&gt;#rstats&lt;/a&gt; &lt;a href="https://t.co/KRKKQvlGX4"&gt;pic.twitter.com/KRKKQvlGX4&lt;/a&gt;&lt;/p&gt;&amp;mdash; David Smith (`@revodavid`) &lt;a href="https://twitter.com/revodavid/status/905899118446436358"&gt;September 7, 2017&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="//platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;p&gt;A
have been surprised to learn that Her Majesty the Queen is listed as an author on a number of our packages.
For example, in the
package:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Author: Alex M Chubaty [aut, cre],
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Eliot J B McIntire [aut],
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Yong Luo [ctb],
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Steve Cumming [ctb],
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Her Majesty the Queen in Right of Canada, as represented by
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; the Minister of Natural Resources Canada [cph]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note, however, that Her Majesty&amp;rsquo;s
not as a package &lt;em&gt;author&lt;/em&gt; (&lt;code&gt;aut&lt;/code&gt;) but as the &lt;em&gt;copyright holder&lt;/em&gt; (&lt;code&gt;cph&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s common practice in many companies to attribute copyright to your employer, and there are several R packages that list a company as copyright holder.
For example, take a look at the packages produced by RStudio (&lt;em&gt;e.g.&lt;/em&gt;,
,
).&lt;/p&gt;
&lt;p&gt;As a Canadian public servant, the Crown holds copyright on our work, including R packages.
(Next time you&amp;rsquo;re reading a scientific paper produced by a federal employee note the copyright &amp;ndash; most publishers assign Crown Copyright in these cases instead of the publisher itself maintaining copyright. &lt;em&gt;E.g.&lt;/em&gt;,
.)&lt;/p&gt;
&lt;blockquote class="twitter-tweet" data-lang="en"&gt;&lt;p lang="en" dir="ltr"&gt;Queen Elizabeth II has another &lt;a href="https://twitter.com/hashtag/rstats?src=hash"&gt;#rstats&lt;/a&gt; package on CRAN. This one&amp;#39;s for reproducible research. &lt;a href="https://t.co/T71aefEPTL"&gt;https://t.co/T71aefEPTL&lt;/a&gt;&lt;/p&gt;&amp;mdash; Thomas Leeper (`@thosjleeper`) &lt;a href="https://twitter.com/thosjleeper/status/894176471392059392"&gt;August 6, 2017&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="//platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;p&gt;So while it may be a little surprising to see The Queen listed (as copyright holder) in the authors list for several R packages, assigning copyright to one&amp;rsquo;s employer is common in general, and expected for public servants in Canada (and likely other Commonwealth countries).&lt;/p&gt;</description></item><item><title>Using the latest GDAL with R packages on macOS</title><link>https://alexchubaty.com/posts/2016-12-13-using-latest-gdal-macos/</link><pubDate>Tue, 13 Dec 2016 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2016-12-13-using-latest-gdal-macos/</guid><description>&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; see more recent version of this post
.&lt;/p&gt;
&lt;p&gt;I wanted to play around with the new
package, which requires the latest GDAL (&amp;gt;= 2.0.0), GEOS (&amp;gt;= 3.3.0), and PROJ.4 (&amp;gt;= 4.8.0).
However, the version of GDAL
is 1.11.4, so I needed to update to the latest version and reinstall a few R packages in order to get &lt;code&gt;sf&lt;/code&gt; to work on macOS.&lt;/p&gt;
&lt;h2 id="update-gdal"&gt;Update GDAL&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## unlink the previous GDAL version&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew unlink gdal
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## update GDAL to the latest version (2.1.2)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew tap osgeo/osgeos4mac
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install gdal2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew link --force gdal2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="reinstall-r-spatial-packages"&gt;(Re)install R spatial packages&lt;/h2&gt;
&lt;p&gt;Next, we need to install a few packages from source in order to use the new GDAL libraries:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## (re)install spatial packages from source&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;install.packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;rgeos&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;sf&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;sp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;source&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## rgdal requires some additional configuration to build correctly:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## based on http://stackoverflow.com/a/26836125/1380598&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;install.packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;rgdal&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;source&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;configure.args&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;--with-proj-include=/usr/local/include&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;--with-proj-lib=/usr/local/lib&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rgdal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;## confirm the GDAL version being used&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>meow: the most anticipated R package of 2015</title><link>https://alexchubaty.com/posts/2015-02-09-meow/</link><pubDate>Mon, 09 Feb 2015 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2015-02-09-meow/</guid><description>&lt;p&gt;In preparing a presentation on developing R packages using RStudio for the Victoria R Users Meetup Group this month, organizer Kiri Whan and I put together a very simple demo R package.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;UPDATE 2015/02/09: I didn&amp;rsquo;t notice the conflict with the package name; thanks Scott Chamberlain for
. I&amp;rsquo;ve renamed the package to &lt;code&gt;meow&lt;/code&gt; and updated the links below.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;From the &lt;code&gt;README&lt;/code&gt; at
:&lt;/p&gt;
&lt;h2 id="meow-get-random-pictures-of-cats"&gt;&lt;code&gt;meow&lt;/code&gt;: Get random pictures of cats.&lt;/h2&gt;
&lt;p&gt;This package doesn&amp;rsquo;t do much, but it&amp;rsquo;s adorable:&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="http://thecatapi.com/api/images/get?format=src&amp;amp;type=jpg&amp;amp;size=med" alt="" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Use &lt;code&gt;meow()&lt;/code&gt; to fetch a random cat photo from
plot it in yor R session. Meow!&lt;/p&gt;
&lt;h3 id="installation"&gt;Installation&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;devtools::install_github(&amp;quot;achubaty/meow&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id="reporting-bugs"&gt;Reporting Bugs&lt;/h3&gt;
&lt;p&gt;
&lt;/p&gt;</description></item><item><title>Installing rgdal on OSX</title><link>https://alexchubaty.com/posts/2014-08-05-installing-rgdal-osx/</link><pubDate>Tue, 05 Aug 2014 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2014-08-05-installing-rgdal-osx/</guid><description>&lt;p&gt;This is actually really easy to do, but most of the google hits I came across were old (from 2010) or horribly complex (building &lt;code&gt;gdal&lt;/code&gt; and &lt;code&gt;proj4&lt;/code&gt; from source then building &lt;code&gt;rgdal&lt;/code&gt; itself).&lt;/p&gt;
&lt;p&gt;First, this assumes you already have &lt;code&gt;homebrew&lt;/code&gt; installed &lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. If not, see
for the one-liner terminal install.&lt;/p&gt;
&lt;p&gt;Next, install &lt;code&gt;gdal&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install gdal
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then open &lt;code&gt;RStudio&lt;/code&gt; (for some reason it didn&amp;rsquo;t work using R in the terminal&amp;hellip;) and install the package from source:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;install.packages(&amp;#34;rgdal&amp;#34;, type=&amp;#34;source&amp;#34;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s it. Seriously easy.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Update: fixed typos in &lt;code&gt;brew&lt;/code&gt; commands&lt;/em&gt;&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;If you use &lt;code&gt;macports&lt;/code&gt; the process is similarly simple. See
.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Essential software for biology grad students: Part III Writing Tools</title><link>https://alexchubaty.com/posts/2013-07-15-essential-software-for-biology-grad-students-part-iii-writing-tools/</link><pubDate>Mon, 15 Jul 2013 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2013-07-15-essential-software-for-biology-grad-students-part-iii-writing-tools/</guid><description>&lt;p&gt;Whenever I used to sit down in front of the computer to write anything other than an email, I would immediately open Microsoft Word and start clacking away on the keyboard. When I switched operating systems (away from Windows) I began using Open Office Writer and even now I still use Libre Office Writer for some of my writing needs. Each of these word processors offer similar sets of tools and can effectively be used for a wide range of writing tasks, from letters to essays, yet I feel most people use Word not because it&amp;rsquo;s always the best tool for the job, but because it&amp;rsquo;s ubiquitous and familiar.&lt;/p&gt;
&lt;p&gt;There are plenty of limitations to using Word (and Writer), especially when it comes to 1) complex formatting (especially working with equations), 2) sharing documents and collaborating with others, 3) version control, and 4) converting to different file types.&lt;/p&gt;
&lt;p&gt;To overcome these limitations and to make writing easier, I want to share my favourite writing tools &amp;ndash; 
 and 
, which use plain-text file formats and can be easily converted to any other file type with 
.&lt;/p&gt;
&lt;p&gt;The use of plain text format is important.
 like
 works perfectly with plain-text files, showing you which lines have changed between versions. However, this version differencing isn&amp;rsquo;t possible using &lt;em&gt;binary&lt;/em&gt; file formats like those used by Word (.doc and .docx). Additionally, you can open plain-text files on any computer without any special (proprietary!) software, so 10 years from now when you want to revisit an old document, you can do so without having to ensure you keep an old computer with old software around.&lt;/p&gt;
&lt;h3 id="you-shouldnt-have-to-worry-about-formatting"&gt;You shouldn&amp;rsquo;t have to worry about formatting&lt;/h3&gt;
&lt;p&gt;Markdown and LaTeX files are markup languages, which means that the text in a document is annotated in a way that indicates the structure and formatting of the text, using tags. For example, bolded text in &lt;acronym title="HyperText Markup Language"&gt;HTML&lt;/acronym&gt; (used for webpages) would be written like this: &lt;code&gt;&amp;lt;b&amp;gt;bold text here&amp;lt;/b&amp;gt;&lt;/code&gt;. Markdown makes this even simpler, so you spend less time formatting your document while writing, which means you can focus on actually writing rather than formatting.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s fantastically easy to learn the markdown syntax and create documents with markdown:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Simple Headings
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;## And Subheadings
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Here&amp;#39;s some paragraph text with some words *emphasized* with italics.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Others are **bolded** for emphasis.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;### Don&amp;#39;t Forget Subsubheadings
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;You can keep adding headings and subheadings by using more hashes!
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# What about lists?
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- lists are easy to make
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- just use 4 spaces for sub-points
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- numbered lists are also supported
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Markdown is great for embedding code too
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;You just put your code `inside the backticks` or use blocks of code.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Blockquotes are just as easy
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt; Look at me go!
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Check out [Markdown basics](http://daringfireball.net/projects/markdown/basics)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;to learn more.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The markdown text above produces this:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://alexchubaty.com/uploads/2013/07/markdown.png"&gt;&lt;img class="size-medium wp-image-229 aligncenter" alt="markdown" src="https://alexchubaty.com/uploads/2013/07/markdown-201x300.png" width="201" height="300" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And it doesn&amp;rsquo;t stop there. Markdown also supports citations and references with bibtex, which means that you can easily write up that thesis chapter or manuscript, not worrying about the final format until you&amp;rsquo;re ready to convert your markdown file to whatever file format you require.&lt;/p&gt;
&lt;h3 id="equations-and-more"&gt;Equations and more!&lt;/h3&gt;
&lt;p&gt;Markdown is incredibly easy to learn, and will cover most of your writing needs, but if you are (or will be) making heavy use of code, equations, and statistics, then you need to be using LaTeX. The syntax is more complex than Markdown, but it hands-down beats MS Word for formatting, equation typesetting, and portability between computers. I&amp;rsquo;ve done all my thesis stuff, including manuscripts, in LaTeX and output as PDF or converted to .doc format when needed.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://alexchubaty.com/uploads/2013/07/mpb-game-dpe.png"&gt;&lt;img class="aligncenter wp-image-232" title="a LaTeX equation" alt="a LaTeX equation" src="https://alexchubaty.com/uploads/2013/07/mpb-game-dpe-1024x231.png" width="625" height="140" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To make your introduction to LaTeX easier, I recommend starting out using an editor like
, which is cross platform and come with a GUI to assist with inserting various document elements. If you will be using equations, you&amp;rsquo;ll want to make sure you use the &lt;code&gt;amsmath&lt;/code&gt; package. There are a lot of other great packages for latex which will help with everything from document formatting and layout, to citation formatting with bibtex, as well as
. I also recommend checking out the
site to get Q&amp;amp;A help with everything (La)TeX.&lt;/p&gt;
&lt;p&gt;Going further and using R+LaTeX+Sweave and you&amp;rsquo;ve got yourself a full-on powerhouse of reproducible, portable document publishing. Also remember, .tex files are simply a type of text file, so they work with version control software like Git.&lt;/p&gt;
&lt;h3 id="file-conversion-with-pandoc"&gt;File conversion with Pandoc&lt;/h3&gt;
&lt;p&gt;Lastly, I&amp;rsquo;ll quickly mention that the best way to take your Markdown and LaTeX documents and convert them to almost any type of document file including (e.g., .tex, .html, .pdf, .doc, .odt) is using Pandoc. It&amp;rsquo;s a simple command-line tool, and
.&lt;/p&gt;
&lt;h3 id="use-them-everyday"&gt;Use them everyday&lt;/h3&gt;
&lt;p&gt;Like any new software, there is a bit of a learning curve, so the best way to get used to it is simply to use it. Using markdown for everyday note taking or creating and maintaining your cv with markdown/LaTeX are great ways to gain familiarity with these tools. Start using them today. Start using them with your collaborators. You (and they) won&amp;rsquo;t be disappointed.&lt;/p&gt;</description></item><item><title>Essential software for biology grad students: Part II Backups and Version Control</title><link>https://alexchubaty.com/posts/2013-07-11-essential-software-for-biology-grad-students-part-ii-backups-and-sync/</link><pubDate>Thu, 11 Jul 2013 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2013-07-11-essential-software-for-biology-grad-students-part-ii-backups-and-sync/</guid><description>&lt;h2 id="always-back-up-your-data"&gt;Always. Back up. Your data.&lt;/h2&gt;
&lt;p&gt;Simple, yet for various reasons many people simply don&amp;rsquo;t. Backing up data and documents is critical in the event of random computer (or, more likely, user) failure. &lt;em&gt;Losing your data sucks.&lt;/em&gt; I have seen too many frantic colleagues try to get at data on a failed hard drive: many had some (but not all) of their most important data backed up, but others were left with few options and resorted to spending hundreds of dollars on data recovery assistance.&lt;/p&gt;
&lt;p&gt;Unfortunately, even when people do attempt to make (and regularly use) backups of their data, they either don&amp;rsquo;t backup everything or they backup so infrequently that they end up losing a day&amp;rsquo;s, or a week&amp;rsquo;s, or even a month&amp;rsquo;s worth of work. So in order for a backup regimen to actually protect your data, the key is to &lt;strong&gt;1) backup everything&lt;/strong&gt;, and &lt;strong&gt;2) back up often&lt;/strong&gt;. I&amp;rsquo;ll also add that you should &lt;strong&gt;3) keep a remote copy&lt;/strong&gt; in the event that something happens to your primary backup.&lt;/p&gt;
&lt;p&gt;Ideally, a backup solution will deal with all three of these points, and I&amp;rsquo;ll discuss some options below.&lt;/p&gt;
&lt;h3 id="external-hard-drives-or-usb-drives"&gt;External hard drives or USB drives&lt;/h3&gt;
&lt;p&gt;Hard drives are cheap, and the storage capacity of portable external hard drives is huge. You can buy a 2TB external drive for under $100. So, for relatively low cost, you can effectively back up all of your data (music and movies included) to and external hard drive and be done with it, right?&lt;/p&gt;
&lt;p&gt;Not quite. The problem with using an external hard drive is that you need to remember to plug it in and backup your computer at least once a day in order to keep your backups current. Not only that, but you will also need to ensure you have a remote copy somewhere in case you lose or damage your external hard drive.&lt;/p&gt;
&lt;h3 id="network-attached-storage"&gt;Network Attached Storage&lt;/h3&gt;
&lt;p&gt;I like NAS devices because, like external hard drive they aren&amp;rsquo;t too expensive, yet they overcome the limitation of having to remember to manually initiate backups. Basically, a NAS device plugs into your router and sits on the network, allowing you (or others on your network) to access the files stored. All you need to do is configure your computer&amp;rsquo;s operating system to backup to the NAS, and voila! If anything happens and you need to restore from backup you simply tell your computer to restore from the NAS.&lt;/p&gt;
&lt;p&gt;The downside is that your backups will only run when you are connected to the network on which the NAS resides. So if you go away to a conference for a few days, or you have a super-productive day at school, you&amp;rsquo;d better make sure nothing happens to your data before you get home to backup the work! You&amp;rsquo;ll also need to keep a remote backup copy handy.&lt;/p&gt;
&lt;h3 id="email"&gt;Email&lt;/h3&gt;
&lt;p&gt;One way of ensuring you have a remote copy of your work is to email it to yourself. This works fine once in a while, but if you were to email every file to yourself every time you made changes, you&amp;rsquo;d likely fill up your inbox or go crazy. Plus, something will probably slip through.&lt;/p&gt;
&lt;h3 id="university-ftp-server"&gt;University FTP Server&lt;/h3&gt;
&lt;p&gt;I should probably mention that most Universities do provide online storage for their students - usually a couple gigabytes&amp;rsquo; worth - that is accessible over FTP or similar. It&amp;rsquo;s worth checking out, even if it doesn&amp;rsquo;t give you much storage space.&lt;/p&gt;
&lt;h3 id="the-cloud"&gt;The Cloud&lt;/h3&gt;
&lt;p&gt;In the last several years there has been a huge increase not only in the number of online cloud storage providers but also a increase in the amount of free storage space they offer their users. These cloud storage providers offer a desktop client that runs on your computer and continuously monitors changes to files, which are then uploaded to the storage servers. Thus you can hit all three &amp;ldquo;must haves&amp;rdquo; with these services: your files all get backed up, in real time, and you maintain remote copies of your data.&lt;/p&gt;
&lt;p&gt;I personally use &lt;a href="http://www.dropbox.com"&gt;Dropbox&lt;/a&gt;, but other options include &lt;a href="https://one.ubuntu.com/"&gt;UbuntuOne&lt;/a&gt;, &lt;a href="https://spideroak.com/"&gt;SpiderOak&lt;/a&gt;, and others. These services give you several GB worth of online storage and allow you to keep your files synchronized across multiple computers, and can also be accessed via web interface. These cloud storage providers give you more space with a paid account, but with Dropbox at least, I get additional space for signing up with an educational email address and for every referral I make (the referee also gets bonus space). Space hasn&amp;rsquo;t been an issue for me.&lt;/p&gt;
&lt;p&gt;The other awesome feature of Dropbox is that it provides &lt;em&gt;version control.&lt;/em&gt; Using the web interface, you can view previous versions of your files, and also roll back changes to restore previous versions or undelete things from your Dropbox. It also provides good collaboration options, allowing you to create shared folders for group projects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;One warning:&lt;/strong&gt; BC Privacy Legislation prohibits storing personal information on non-Canadian servers. This means that, for example as a TA or instructor, you can&amp;rsquo;t store student grades etc. using cloud storage, because the servers are located in the USA.&lt;/p&gt;
&lt;h3 id="summary"&gt;Summary&lt;/h3&gt;
&lt;p&gt;Overall, the easiest way to have automated backups is to use a cloud storage provider like Dropbox. Although the free plans have limited storage space, the limits are easily increased. Besides, you can&amp;rsquo;t beat &amp;ldquo;no fuss&amp;rdquo; when it comes to backing up your work! However, in practice I do use some combinations of the other backup methods, depending on the type of data and how much there is to move between computers.&lt;/p&gt;
&lt;h2 id="version-control"&gt;Version Control&lt;/h2&gt;
&lt;p&gt;As mentioned above, some cloud storage/backup providers offer version control, which allows you to view and revert changes made to your files. Dropbox certainly does a good job at this, and the undelete feature has saved me on several occasions. However, the main drawback of Dropbox&amp;rsquo;s version control is that it operates on a &lt;em&gt;per file&lt;/em&gt; basis.&lt;/p&gt;
&lt;p&gt;Often when writing papers (or code), I trash or substantially rewrite something, only later to realize that what I overwrote wasn&amp;rsquo;t that bad. Hitting ctrl-z will undo the changes, but it also means it will undo any progress you&amp;rsquo;ve made. Restoring previous version of your document using Dropbox will get you an old copy, but you still have to hunt around to find exactly which version you want to restore. And what if you actually want to incorporate changes from multiple restored files?&lt;/p&gt;
&lt;p&gt;This is where &amp;ldquo;real&amp;rdquo; version control software (VCS) comes in handy. Now, I&amp;rsquo;m new to the VCS game, having only started using &lt;a href="https://github.com/"&gt;Git&lt;/a&gt; this year, but already I can see its power and potential. If you&amp;rsquo;re working with text files - be it a paper written in Markdown (maybe LaTeX), or chunks of code - you will want to use Git.&lt;/p&gt;
&lt;p&gt;This post has run rather long, so I won&amp;rsquo;t be providing a &amp;ldquo;how to&amp;rdquo;, but 
 provides great help getting started. You don&amp;rsquo;t &lt;em&gt;need&lt;/em&gt; to use GitHub at all to use Git - you can keep everything local (in a Dropbox folder!) and still have access to all of your project files. Try it. Use it.&lt;/p&gt;</description></item><item><title>Essential software for biology grad students: Part I Overview</title><link>https://alexchubaty.com/posts/2013-07-10-essential-software-for-biology-grad-students-part-i-overview/</link><pubDate>Wed, 10 Jul 2013 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2013-07-10-essential-software-for-biology-grad-students-part-i-overview/</guid><description>&lt;p&gt;When I started grad school, I had no idea at the time just how much I&amp;rsquo;d learn doing a PhD. I&amp;rsquo;m not just talking about the &amp;ldquo;big picture&amp;rdquo; stuff: how to do research, design and conduct experiments, analyze data, and synthesize information. I mean all of the day-to-day skills associated with academic writing, data entry, and organization.&lt;/p&gt;
&lt;p&gt;Over the next few weeks, I&amp;rsquo;ll explain a bit about the workflows I use and the various pieces of software that make my life quite a bit easier. After numerous discussions with colleagues over the years, providing various software and workflow recommendations to others, and attending (and running) various software workshops, it turns out I have a lot of suggestions for fellow biology grad students.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll try to keep my recommendations general, because I think they are applicable not just to grad students in biology, but are also likely of interest to undergrads (even post-grads) in the sciences and perhaps elsewhere. I won&amp;rsquo;t put together detailed &lt;em&gt;How-To&lt;/em&gt;&amp;rsquo;s, and I won&amp;rsquo;t be able to cover everything, but here&amp;rsquo;s an overview of what to expect:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
will cover some essential computing basics: automated backups, using online (cloud) storage, and version control;&lt;/li&gt;
&lt;li&gt;
will deal with different writing tools including Microsoft Word, Libre Office Writer, Markdown, Pandoc, and LaTeX;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Part IV&lt;/strong&gt; will discuss reference management and citation software options;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Part V&lt;/strong&gt; will touch on using databases instead of spreadsheets;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Part VI&lt;/strong&gt; will delve into statistics software and the majestic use of R for stats, graphics, and (if I have time) get into using Sweave with R and LaTeX;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Part VII&lt;/strong&gt; will go into a little bit about programming and shell scripting;&lt;/li&gt;
&lt;li&gt;and finally, &lt;strong&gt;Part VIII&lt;/strong&gt; will wrap things all up.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So stay tuned! I&amp;rsquo;m still fleshing out my ideas on some of these topics, so as we go along I look forward to comments and suggestions.&lt;/p&gt;</description></item><item><title>more on journal abbreviations in Mendeley</title><link>https://alexchubaty.com/posts/2013-06-20-more-on-journal-abbreviations-in-mendeley/</link><pubDate>Thu, 20 Jun 2013 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2013-06-20-more-on-journal-abbreviations-in-mendeley/</guid><description>&lt;p&gt;Wow, my
on the topic are getting a lot of hits!&lt;/p&gt;
&lt;p&gt;Some exciting info for anyone still struggling with getting abbreviated journal names working with Mendeley:
!&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;This is currently on our roadmap for Mendeley Desktop 1.10. Expected release date is the start of August.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;From the mockups and descriptions the good folks at Mendeley have provided it looks like they&amp;rsquo;re doing a great job of addressing this shortcoming of their current product.&lt;/p&gt;</description></item><item><title>website updates</title><link>https://alexchubaty.com/posts/2013-04-26-website-updates/</link><pubDate>Fri, 26 Apr 2013 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2013-04-26-website-updates/</guid><description>&lt;p&gt;I just transferred my hosting away from GoDaddy (good riddance!) and am now self-hosting this site on a
.&lt;/p&gt;
&lt;p&gt;There may be some DNS and 404 hiccups for the next 48 hours or so while all the new settings &amp;ldquo;take&amp;rdquo;. Please update your bookmarks accordingly, and thank you for you patience.&lt;/p&gt;</description></item><item><title>enabling Libre/OpenOffice plugin for Mendeley 1.5</title><link>https://alexchubaty.com/posts/2012-04-13-enabling-libreopenoffice-plugin-for-mendeley-1-5/</link><pubDate>Fri, 13 Apr 2012 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2012-04-13-enabling-libreopenoffice-plugin-for-mendeley-1-5/</guid><description>&lt;p&gt;I upgraded to using
v 1.5 (because previous versions don&amp;rsquo;t work on Ubuntu 12.04 Precise) and I had problems installing the OpenOffice plugin. Normally this is easy: in Mendeley you select the &lt;em&gt;Tools&lt;/em&gt; menu and go to &lt;em&gt;Install OpenOffice Plugin&lt;/em&gt;. However, for whatever reason the software can&amp;rsquo;t find the plugin, and I get this error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Mendeley couldn't locate unopkg in the default location.
It should be in the 'program' subdirectory of the path where
OpenOffice is installed. Please press OK to locate it.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Fortunately, it was easy to find and install. I clicked &lt;em&gt;OK&lt;/em&gt; and closed the file browser window that popped up. Then I opened a nautilus window (file browser), clicked the search button, selected my filesystem&amp;rsquo;s root partiton (see image below) and searched for &lt;code&gt;.oxt&lt;/code&gt;, which is the file extension used for OpenOffice and LibreOffice plugins. My search returned the pulgin for version 1.5 (plus some older versions I had previously installed).&lt;/p&gt;
&lt;p&gt;After right-clicking the plugin file and selecting &lt;em&gt;Open with LibreOffice&lt;/em&gt; started the install, which I confirmed and voila!&lt;/p&gt;</description></item><item><title>list of abbreviated journal names</title><link>https://alexchubaty.com/posts/2012-02-28-list-of-abbreviated-journal-names/</link><pubDate>Tue, 28 Feb 2012 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2012-02-28-list-of-abbreviated-journal-names/</guid><description>&lt;p&gt;As a followup to my
, I wrote a script to generate the master list of journal names and their abbreviations from Web of Science.&lt;/p&gt;
&lt;p&gt;The script is designed to be used in conjunction with the
, and is also written in perl (which I&amp;rsquo;m still learning) and can be downloaded
 or viewed
. Improvements and suggestions welcome.&lt;/p&gt;
&lt;p&gt;At the bottom of the script is a list of my custom journal names and abbreviations. Feel free to adjust the script to suit your needs.&lt;/p&gt;
&lt;p&gt;To run the script:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;save it to the &lt;em&gt;jabbrev&lt;/em&gt; directory;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;open a terminal and type:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cd path/to/jabbrev
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mv getJlist.txt getJlist.pl
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;chmod a+x getJlist.pl
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./getJlist.pl
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The script replaces the &lt;code&gt;masterlist.txt&lt;/code&gt; file with one containing the recently downloaded list of journals. Alternatively, just
. Because this master list is pretty big (~3.7 MB), you&amp;rsquo;ll want to extract only those journals that are in your Mendeley database. To do this,  run &lt;code&gt;script.pl&lt;/code&gt; (
).&lt;/p&gt;</description></item><item><title>Abbreviated Journal Names in Mendeley [updated]</title><link>https://alexchubaty.com/posts/2012-02-09-abbreviated-journal-names-in-mendeley-updated/</link><pubDate>Thu, 09 Feb 2012 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2012-02-09-abbreviated-journal-names-in-mendeley-updated/</guid><description>&lt;p&gt;&lt;em&gt;UPDATE: I just posted
. This feature is coming soon to Mendeley!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Several journals require abbreviated journal names, but as of yet Mendeley doesn&amp;rsquo;t make this possible. Or so I thought. After coming across
I decided to try to get this functionality working on my computers.&lt;/p&gt;
&lt;p&gt;To summarize, you can get Mendeley to read in a list of abbreviated journal names by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;creating a folder inside the Mendeley data  directory called &amp;lsquo;&lt;em&gt;journalAbbreviations&lt;/em&gt;&amp;rsquo;;&lt;/li&gt;
&lt;li&gt;placing a formatted text file named &amp;lsquo;&lt;em&gt;default.txt&lt;/em&gt;&amp;rsquo; inside this directory. Each line of this text file needs to contain the full name of the journal, a tab character, and the abbreviated journal name.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;ldquo;Easy&amp;rdquo;, I thought. All I needed was to find a list of full journal names and their abbreviations for my field and make sure it was formatted correctly. Turns out the few lists I did find were incomplete: they didn&amp;rsquo;t have all the journals I cite. I don&amp;rsquo;t want to have to maintain a text file by hand, so I looked to a more &amp;ldquo;automated&amp;rdquo; approach, outlined below.&lt;/p&gt;
&lt;p&gt;I use both BibTeX and Mendeley for my references, and have setup Mendeley to automagically update and maintain my bibliography (&lt;em&gt;.bib&lt;/em&gt;) files. This is key to obtaining a list of the journals I use - I extracted this info from the &lt;em&gt;.bib&lt;/em&gt; files and compared this list of journals against the master list to get the abbreviations.&lt;/p&gt;
&lt;p&gt;First, &lt;del&gt;I obtained (by hand, sadly) a list of all the ISI journals indexed by Web of Science from
I copy/pasted all the journals into a text file named &amp;lsquo;&lt;em&gt;masterlist.txt&lt;/em&gt;&amp;rsquo;.&lt;/del&gt; I wrote a script to generate a master list of all journal names and their abbreviations from Web of Science (
). This file is pretty big, and not very helpful at that point. I don&amp;rsquo;t need ALL of those journals, only the journals I cite from my Mendeley library.&lt;/p&gt;
&lt;p&gt;The Perl script I wrote (with Charlie and Filipe) does all of this and saves the list of journals used directly into the Mendeley data folder.&lt;/p&gt;
&lt;p&gt;To get this working yourself, follow the steps below:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; This was written for and tested on a machine running Ubuntu 11.10 64-bit with a default Mendeley installation (also tested and run on Ubuntu 12.04 and 12.10). IT WON&amp;rsquo;T WORK ON WINDOWS OR A MAC WITHOUT SOME CHANGES TO THE PERL SCRIPT because the Mendeley directories are in different places on different operating systems. There may be some funny perl-related issues going between OSes too that I&amp;rsquo;m not aware of.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Download and save
and unzip the directory &amp;lsquo;&lt;em&gt;jabbrev&lt;/em&gt;&amp;rsquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;open a terminal (and keep it open) and type:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cd path/to/jabbrev
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In Mendeley go to &amp;lsquo;&lt;em&gt;Tools&lt;/em&gt;&amp;rsquo; &amp;ndash;&amp;gt; &amp;lsquo;&lt;em&gt;Options&lt;/em&gt;&amp;rsquo; and select the &amp;lsquo;&lt;em&gt;BibTeX&lt;/em&gt;&amp;rsquo; tab.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check the box &amp;lsquo;Enable BibTeX syncing&amp;rsquo; and select either:
&amp;lsquo;&lt;em&gt;Create one BibTeX file for my whole library&lt;/em&gt;&amp;rsquo; or &amp;lsquo;&lt;em&gt;Create one BibTeX file per collection&lt;/em&gt;&amp;rsquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the path to where these BibTeX files will be saved (e.g., &lt;code&gt;~/Documents/Mendeley/bibliographies&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &amp;lsquo;&lt;em&gt;Apply&lt;/em&gt;&amp;rsquo; and &amp;lsquo;&lt;em&gt;OK&lt;/em&gt;&amp;rsquo;, wait for Mendeley to generate the files, then exit Mendeley.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In a nautilus window, go to the bibliographies directory you just set up (e.g., &lt;code&gt;~/Documents/Mendeley/bibliographies&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Switch back to your open terminal window and allow the script to be executed by typing:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;chmod a+x script.pl
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The script accepts a filepath for each of the masterlist and multiple bibtex files. Execute the script by typing:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./script.pl /path/to/masterlist.txt /path/to/bibfile1.bib [/path/to/bibfile2.bib ...]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sit back and wait (it may take a while to run, especially with a large library!).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Open Mendeley back up, go to &amp;lsquo;&lt;em&gt;View&lt;/em&gt;&amp;rsquo; &amp;ndash;&amp;gt; &amp;lsquo;&lt;em&gt;Citation Style&lt;/em&gt;&amp;rsquo; &amp;ndash;&amp;gt; &amp;lsquo;&lt;em&gt;More Styles&amp;hellip;&lt;/em&gt;&amp;rsquo; and select a citation format that uses abbreviated journal names (e.g., Vancouver). You should now be able to generate bibliographies in Word and Open(Libre)Office documents with abbrev j names!*&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;*note that the abbreviated names do NOT have periods.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; view the perl script at 
 [updated 2013-02-27]. It&amp;rsquo;s not perfect (yet) but it&amp;rsquo;s mostly there. Suggestions welcome, especially how to deal with some of the funny cases.&lt;/p&gt;</description></item><item><title>Easily make custom Mendeley citation styles</title><link>https://alexchubaty.com/posts/2012-02-01-easily-make-custom-mendeley-citation-styles/</link><pubDate>Wed, 01 Feb 2012 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2012-02-01-easily-make-custom-mendeley-citation-styles/</guid><description>&lt;p&gt;I came across this incredibly useful site today:&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;No longer need to manually edit custom citation style (CSL) files for Mendeley (and Zotero) within a text file!!!&lt;/p&gt;</description></item><item><title>Finding Symbol Commands for LaTeX</title><link>https://alexchubaty.com/posts/2012-01-28-finding-symbol-commands-for-latex/</link><pubDate>Sat, 28 Jan 2012 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2012-01-28-finding-symbol-commands-for-latex/</guid><description>&lt;p&gt;Ever been writing a document in [latex]\LaTeX[/latex] and had to look up the code for a particular symbol? Google usually directs me to the
but scrolling through and finding the symbol I&amp;rsquo;m looking for is time consuming. However, today I came across this site (
) which lets you draw the symbol you are looking for and it tries to match it, providing symbol suggestions and letting you know the [latex]\LaTeX[/latex] code and the package to use!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://detexify.kirelabs.org/"&gt;&lt;img class="alignnone size-medium wp-image-162" alt="detexify" src="https://alexchubaty.com/uploads/2012/01/detexify-300x236.png" width="300" height="236" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Constructing Pedigrees in R</title><link>https://alexchubaty.com/posts/2011-11-14-constructing-pedigrees-in-r/</link><pubDate>Mon, 14 Nov 2011 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2011-11-14-constructing-pedigrees-in-r/</guid><description>&lt;p&gt;I was looking for a good way to draw pedigrees using software, without having to fuss drawing them &amp;ldquo;by hand&amp;rdquo; using a drawing program. Lo and behold, I came across a few different packages in R that allow me to do just that!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://alexchubaty.com/uploads/2013/04/pedigree.png"&gt;&lt;img class="alignnone size-medium wp-image-60" alt="pedigree" src="https://alexchubaty.com/uploads/2013/04/pedigree-300x200.png" width="300" height="200" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Using the &lt;code&gt;kinship2&lt;/code&gt; package, I was quickly able to produce a nice pedigree for a family with two genetic conditions: factor VIII deficiency (haemophilia) and myotonic dystrophy. Factor VIII deficiency is a classic example of a sex-linked recessive trait, and myotonic dystrophy follows autosomal dominant inheritance. In this pedigree, I show the status of affected and unaffected indiviudals (not carriers), using the following bits of code in R.&lt;/p&gt;
&lt;p&gt;First, let&amp;rsquo;s install (if needed) and load the &lt;code&gt;kinship2&lt;/code&gt; package:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;kinship2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;install.packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;kinship2&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;kinship2&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we need to code several variables which will correspond to all of the individuals in the pedigree. First, we need individual ID numbers:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ids&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="m"&gt;49&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Second, we need to identify the father and mother of each individual using the individual ID numbers above:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dad&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;43&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;43&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;47&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;29&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;29&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;29&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;29&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;31&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;31&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;31&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;36&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;37&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;mom&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;44&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;44&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;18&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;46&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;46&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;46&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;46&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;46&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;46&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;46&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;48&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;35&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;13&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we code the sex and status (0=alive, 1=dead) of each individual:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sexes&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dead&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here is where we code the affected status of each individual (0=unaffected, 1=affected, NA=unknown). We need to bind these columns together in a matrix (you can have up to 4 traits; one per column):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;F8&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MD&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kc"&gt;NA&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;affect&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;as.matrix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cbind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MD&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And now we create the pedigree object and plot it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;family&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;pedigree&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dadid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;dad&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;momid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;mom&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;affected&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;affect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sex&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sexes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;dead&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;plot.pedigree&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;family&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;pedigree.legend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;family&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;bottomright&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;labels&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Factor VIII\nDeficiency&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Myotonic\nDystrophy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cex&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;radius&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s the basics! Of course, with a large pedigree I expect this becomes a bit unruly, but for smaller examples like this one it&amp;rsquo;s relatively easy to put together.&lt;/p&gt;</description></item><item><title>Custom Citation Styles in Mendeley</title><link>https://alexchubaty.com/posts/2011-11-07-custom-citation-styles-in-mendeley/</link><pubDate>Mon, 07 Nov 2011 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2011-11-07-custom-citation-styles-in-mendeley/</guid><description>&lt;p&gt;I&amp;rsquo;m an avid user of 
 citation management software (CMS), and am pleased with the capabilities of this cross-platform, open-source, and &lt;em&gt;free&lt;/em&gt; referencing tool. However, one limitation I&amp;rsquo;ve encountered is that it does not have very many citiation styles preinstalled, and although many additional formats are available to download through the Mendeley interface, it does not (yet) provide a built-in style editor to customize citiation styles.&lt;/p&gt;
&lt;p&gt;Fortunately, Mendeley uses 
 (CSL) which is also used by
 and other CMSs, so not only is it possible to find thousands more citiation styles (e.g., using the 
), but it&amp;rsquo;s also easy to create custom CSL files!&lt;/p&gt;
&lt;p&gt;
 shows you the basics, although note that for Windows 7, the custom style directory is actually located at&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:&lt;span class="se"&gt;\U&lt;/span&gt;sers&lt;span class="se"&gt;\&amp;lt;&lt;/span&gt;USERNAME&amp;gt;&lt;span class="se"&gt;\A&lt;/span&gt;ppData&lt;span class="se"&gt;\L&lt;/span&gt;ocal&lt;span class="se"&gt;\M&lt;/span&gt;endeley Ltd&lt;span class="se"&gt;\M&lt;/span&gt;endeley Desktop&lt;span class="se"&gt;\c&lt;/span&gt;itationStyles-1.0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Using the Vancouver style as a template, I easily created a custom citation style for the Open Forest Science Journal, which required modifying a copy of the &lt;em&gt;vancouver.csl&lt;/em&gt; file:&lt;/p&gt;
&lt;p&gt;To get the numbered citations in text to be displayed using square brackets &amp;ldquo;[]&amp;rdquo; rather than round brackets &amp;ldquo;()&amp;rdquo;, I changed line 120 from:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;layout prefix=&amp;#34;(&amp;#34; suffix=&amp;#34;)&amp;#34; delimiter=&amp;#34;,&amp;#34;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;to&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;layout prefix=&amp;#34;[&amp;#34; suffix=&amp;#34;]&amp;#34; delimiter=&amp;#34;,&amp;#34;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Also, to get the square brackets to show up around the numbers in the bibliography I changed line 126 from:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;citation-number&amp;#34;&lt;/span&gt; &lt;span class="n"&gt;suffix&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;. &amp;#34;&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;to&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;citation-number&amp;#34;&lt;/span&gt; &lt;span class="n"&gt;prefix&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;[&amp;#34;&lt;/span&gt; &lt;span class="n"&gt;suffix&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;] &amp;#34;&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s it! Pretty simple stuff. You can download the modified file here:
.&lt;/p&gt;</description></item><item><title>Exploring Population Dynamics Models using a GUI for R</title><link>https://alexchubaty.com/posts/2011-08-07-exploring-population-dynamics-models-using-a-gui-for-r/</link><pubDate>Sun, 07 Aug 2011 00:00:00 +0000</pubDate><guid>https://alexchubaty.com/posts/2011-08-07-exploring-population-dynamics-models-using-a-gui-for-r/</guid><description>&lt;h3 id="backstory"&gt;Backstory&lt;/h3&gt;
&lt;p&gt;I recently taught a senior-level population dynamics course, and had to decide how best to get my students to be able to play around with the various models we were exploring in class. I ruled out using Excel right away and thought about using &lt;a href="http://www.wolfram.com/mathematica/"&gt;Mathematica&lt;/a&gt; because of its wonderful plotting capabilities and relatively-easy to learn syntax. However, I felt that it would be more trouble that it was worth to try to get either a site license for the students to be able to use the computers at school, as I had ruled out asking the students to purchase their own student copies. Being an avid &lt;a href="http://www.r-project.org"&gt;R&lt;/a&gt; user, I had also thought about using R for the course but was concerned about the learning curve associated with it. I didn&amp;rsquo;t want students getting hung up on coding syntax, but rather, have an opportunity to explore different model parameterizations graphically.&lt;/p&gt;
&lt;p&gt;Just before the course started, someone showed me the &lt;a href="http://cran.r-project.org/web/packages/PBSmodelling/index.html"&gt;PBSmodelling package&lt;/a&gt; and I knew this could be the way to go. PBSmodelling makes it easy to construct a graphical user interface (GUI) for any function in R, in order to create a much more user-friendly interface with which to interact with computer models.&lt;/p&gt;
&lt;p&gt;I took it upon myself to learn the basics of the PBSmodelling package, and I was able to create a fairly slick GUI to run a variety of population dynamics models in R and produce various types of plots in the process.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://alexchubaty.com/uploads/2013/04/screenshot.png"&gt;&lt;img alt="screenshot of R gui" src="https://alexchubaty.com/uploads/2013/04/screenshot-300x217.png" width="300" height="217" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="disclaimer"&gt;Disclaimer&lt;/h3&gt;
&lt;p&gt;This is still a work in progress, and I expect there to be minor bugs (mostly aesthetic I hope!), but I think I&amp;rsquo;m off to great start.&lt;/p&gt;
&lt;h3 id="requirements"&gt;Requirements&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Operating Systems:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows: XP, Vista, 7&lt;/li&gt;
&lt;li&gt;Mac OSX*: 10.5, 10.6&lt;/li&gt;
&lt;li&gt;Linux**: Ubuntu 10.04, 10.10, 11.04&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;R must be installed&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;see
&lt;/li&gt;
&lt;li&gt;the following packages are also required: &lt;code&gt;PBSmodelling&lt;/code&gt;, &lt;code&gt;deSolve&lt;/code&gt;, &lt;code&gt;scatterplot3d&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;*OSX doesn&amp;rsquo;t come with X11 and tcltk installed by default:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;install X11 (&lt;a href="http://support.apple.com/kb/DL641"&gt;
&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;install the update (&lt;a href="http://support.apple.com/kb/DL304"&gt;
&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;restart your computer&lt;/li&gt;
&lt;li&gt;install tcltk for R (
)&lt;/li&gt;
&lt;li&gt;open R and select package installer from the menu&lt;/li&gt;
&lt;li&gt;in the R package installer window, search &amp;ldquo;tcltk&amp;rdquo;&lt;/li&gt;
&lt;li&gt;this returns two results: &lt;code&gt;tcktl2&lt;/code&gt; and &lt;code&gt;gWidgetstcltk&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;select both and be sure to check the &amp;ldquo;install dependencies&amp;rdquo; box.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;** Ubuntu users may need to install tcl/tk:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo apt-get install tcl tk&lt;/code&gt;&lt;/p&gt;
&lt;h3 id="getting-started"&gt;Getting Started&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;download my
, and unzip the contents&lt;/li&gt;
&lt;li&gt;open R from the models_GUI directory&lt;/li&gt;
&lt;li&gt;load the default workspace (&lt;code&gt;models_GUI/.Rdata&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;press the up arrow key to recall previous commands saved in the workspace:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;a. &lt;code&gt;source(&amp;quot;407.SSG.models.R&amp;quot;)&lt;/code&gt; loads the single species growth models interface&lt;/p&gt;
&lt;p&gt;b. &lt;code&gt;source(&amp;quot;407.MSG.models.R&amp;quot;)&lt;/code&gt; loads the multi-species growth models interface&lt;/p&gt;
&lt;p&gt;c. &lt;code&gt;source(&amp;quot;407.disease.models.R&amp;quot;)&lt;/code&gt; loads the disease (SIR) models interface&lt;/p&gt;
&lt;p&gt;d. &lt;code&gt;source(&amp;quot;407.num.approx.R&amp;quot;)&lt;/code&gt; loads the numerical approximation interface&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;use the tabs along the top of each interface to select model type&lt;/li&gt;
&lt;li&gt;to view equations used, press &amp;lsquo;Show Equation&amp;rsquo; button&lt;/li&gt;
&lt;li&gt;parameter values can be changed by editing the fields&lt;/li&gt;
&lt;li&gt;solve the model using current parameter values by pressing &amp;lsquo;Solve&amp;rsquo;&lt;/li&gt;
&lt;li&gt;after solving, plot the model results by pressing &amp;lsquo;Plot&amp;rsquo; (note you can plot to a PDF device by checking the box &amp;lsquo;plot to pdf&amp;rsquo;)&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="download"&gt;Download&lt;/h3&gt;
&lt;p&gt;Link:
&lt;/p&gt;</description></item></channel></rss>