tag:blogger.com,1999:blog-62085199496762700522024-03-14T08:54:06.295+01:00Apply RPůlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-6208519949676270052.post-82172691578274229032018-10-11T06:55:00.001+02:002018-10-11T06:55:09.487+02:00The blog is dead, long live the blog!This blog is now retired. While Blogger makes posting easy, I am currently looking for something that enables me to write in Markdown. Also, "applying R" is no longer a good description of my work.<br />
<br />
To be continued... somewhere else.Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0tag:blogger.com,1999:blog-6208519949676270052.post-4865093118830700252017-05-12T16:30:00.000+02:002017-05-12T16:31:38.712+02:00Buy Your Mother a Domain for a Mother's Day (GoDaddy Domain for GitHub Pages)Mother's Day is coming. Flowers and chocolate are nice and all. But if you want to surprise your mother with something less traditional, you can register her a domain and add Github Page as a gift.<br />
<br />
I have registered <a href="http://simecek.xyz/">simecek.xyz</a> domain a long time ago. Yesterday I discovered it is really easy to connect it to <a href="http://simecek.github.io/">Github Page</a> or <a href="http://simecek.github.io/blog">blog</a>.<br />
<br />
<ol>
<li><b>GitHub:</b><br /><br />In a repository with your Github Pages, create a file <a href="https://github.com/simecek/simecek.github.io/blob/master/CNAME">CNAME</a> and write your domain address in it (e.g. "<a href="http://simecek.xyz/">simecek.xyz</a>")<br><br></li>
<li><b>GoDaddy:</b><br /><br />Find DNS setting for your domain. GoDaddy is changing web interface all the time but it should look something like this<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnMEuWDv1c9hXwLsiGrXvfgnzTVeFhAOfegOS2TzuEzCL7lXo2xLJ8rQtSH51nPPj3wdZS40Oyfony3FaBhKnGmxkr2jDBgUbhha0K1ZqdSg2w_rUn1J2fkAB6-SevHh6aZmEbGySZmYI/s1600/domain.png" style="margin-left: auto; margin-right: auto;"><img border="0" height="492" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnMEuWDv1c9hXwLsiGrXvfgnzTVeFhAOfegOS2TzuEzCL7lXo2xLJ8rQtSH51nPPj3wdZS40Oyfony3FaBhKnGmxkr2jDBgUbhha0K1ZqdSg2w_rUn1J2fkAB6-SevHh6aZmEbGySZmYI/s640/domain.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">DNS Settings for your domain</td></tr>
</tbody></table>
You need to change two values: "A" should be <span style="background-color: white; color: #333333; font-family: "arial" , "helvetica neue" , "helvetica" , sans-serif; font-size: 14px; white-space: nowrap;">192.30.252.153 </span>and CNAME www should be your Github Page's URL (e.g. GITHUB_USER_NAME.github.io).</li>
</ol>
And that is all. Wait a few minutes until the change propagates through the internet and test it.<br />
<br />
<br />Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0tag:blogger.com,1999:blog-6208519949676270052.post-42458401491574383732017-04-26T23:57:00.000+02:002018-10-11T06:39:06.066+02:00Making your plots interactive - updateTwo years ago I have been experimenting with Shiny and interactive plots and I have published here <a href="http://applyr.blogspot.com/2015/02/make-your-r-plots-interactive.html">a post</a> that remains to be one of the most read pages of this blog. I feel guilty about it because I was wrong about almost everything. A few weeks later, the free use of <a href="http://shinyapps.io/">shinyapps.io</a> was over. Meanwhile, <a href="https://plot.ly/r/getting-started/">plotly package</a>, I did not appreciate that time so much, has matured and added more R functionality.<br />
<br />
If you are into ggplot2, it is now super-easy to add interactivity to your graph. Just take your static ggplot object <span style="font-family: "courier new" , "courier" , monospace;">pl</span> like the following<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://simecek.github.io/blog/post/2017-01-26-interactive-graphs-with-plotly-and-ggiraph_files/figure-html/unnamed-chunk-1-1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="285" src="https://simecek.github.io/blog/post/2017-01-26-interactive-graphs-with-plotly-and-ggiraph_files/figure-html/unnamed-chunk-1-1.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">mpg dataset</td></tr>
</tbody></table>
and run<br />
<br />
<span style="background-color: #f9f9f9; font-family: "source code pro" , "menlo" , "monaco" , "courier" , monospace; font-size: 13.7846px; letter-spacing: 0.16px; white-space: pre-wrap;">library(plotly)</span><br />
<span style="background-color: #f9f9f9; font-family: "source code pro" , "menlo" , "monaco" , "courier" , monospace; font-size: 13.7846px; letter-spacing: 0.16px; white-space: pre-wrap;">ggplotly(pl)</span><br />
<br />
That's it. You can configure your tooltip text with <span class="hljs-attribute" style="background-color: #f9f9f9; box-sizing: inherit; font-family: "source code pro" , "menlo" , "monaco" , "courier" , monospace; font-size: 13.7846px; letter-spacing: 0.16px; white-space: pre-wrap;">ggplotly</span><span style="background-color: #f9f9f9; font-family: "source code pro" , "menlo" , "monaco" , "courier" , monospace; font-size: 13.7846px; letter-spacing: 0.16px; white-space: pre-wrap;">(</span><span class="hljs-attribute" style="background-color: #f9f9f9; box-sizing: inherit; font-family: "source code pro" , "menlo" , "monaco" , "courier" , monospace; font-size: 13.7846px; letter-spacing: 0.16px; white-space: pre-wrap;">pl</span><span style="background-color: #f9f9f9; font-family: "source code pro" , "menlo" , "monaco" , "courier" , monospace; font-size: 13.7846px; letter-spacing: 0.16px; white-space: pre-wrap;">, </span><span class="hljs-attribute" style="background-color: #f9f9f9; box-sizing: inherit; font-family: "source code pro" , "menlo" , "monaco" , "courier" , monospace; font-size: 13.7846px; letter-spacing: 0.16px; white-space: pre-wrap;">tooltip</span><span style="background-color: #f9f9f9; font-family: "source code pro" , "menlo" , "monaco" , "courier" , monospace; font-size: 13.7846px; letter-spacing: 0.16px; white-space: pre-wrap;"> = "</span><span class="hljs-attribute" style="background-color: #f9f9f9; box-sizing: inherit; font-family: "source code pro" , "menlo" , "monaco" , "courier" , monospace; font-size: 13.7846px; letter-spacing: 0.16px; white-space: pre-wrap;">text</span><span style="background-color: #f9f9f9; font-family: "source code pro" , "menlo" , "monaco" , "courier" , monospace; font-size: 13.7846px; letter-spacing: 0.16px; white-space: pre-wrap;">")</span>, see <a href="https://simecek.github.io/blog/2017/01/26/interactive-graphs-with-plotly-and-ggiraph-packages/">my Rmarkdown example</a>. And it works not only for a simple scatterplot but for more complex graphs as well, as @cpsievert tweeted today.<br />
<br />
<center>
<blockquote class="twitter-tweet" data-lang="en">
<div dir="ltr" lang="en">
I made <a href="https://twitter.com/galka_max">@galka_max</a> Europe map interactive with 2 more lines of <a href="https://twitter.com/hashtag/rstats?src=hash">#rstats</a> code <a href="https://t.co/KZp0w5YoFH">https://t.co/KZp0w5YoFH</a> <a href="https://t.co/a4GaFJRJVn">pic.twitter.com/a4GaFJRJVn</a></div>
— Carson Sievert (@cpsievert) <a href="https://twitter.com/cpsievert/status/857255029568397314">April 26, 2017</a></blockquote>
<script async="" charset="utf-8" src="//platform.twitter.com/widgets.js"></script>
</center>
<br />
There are now also many easy-to-use <a href="http://gallery.htmlwidgets.org/">htmlwidgets</a>. And with the <a href="https://github.com/davidgohel/ggiraph">ggiraph package</a>, you get now your click as Shiny input.Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0tag:blogger.com,1999:blog-6208519949676270052.post-1799184429510318372017-01-31T18:40:00.001+01:002017-02-01T17:22:30.463+01:00Blogging from RStudio with blogdown packageIn <a href="http://applyr.blogspot.com/2017/01/simple-personal-github-page-with-jekyll.html" target="_blank">my previous post</a>, I described how to make a simple personal Github page with Jekyll. You can blog in R/Markwown this way, you just need to ask <b>rmarkdown </b>to keep .md files and push them (with images and other assets) to Github.<br />
<br />
The <a href="https://github.com/rstudio/blogdown" target="_blank">blogdown</a> package automates this process and open the resulting page in RStudio viewer. You just provide .Rmd files and any time you make a change, <b class="">blogdown</b> crunches all the R chunks, generates .md files and uses pandoc to translate them into HTML pages.<br />
<br />
I am going to use it mainly for code snippets that are too short for this blog but too long for a tweet. Plus I do not wish to forget them. See <a href="https://simecek.github.io/blog/">my blogdown blog</a> on the first figure. Here, I will provide a step-by-step guide how to create a similar one.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLWL5-KsXz2hB-WGjkVzs44Tp0oFJBZ4iYkBEgnl9vypmzXmkyKjD57zz2kx1Fx1b4qIgBvkTQ2N_QHQqsXsaAGfEuUjB-e6nA0K46qywj9rzQbAHQOSQHklZAI6pdeZ9MoZVW16LWOLo/s1600/blog01.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="372" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLWL5-KsXz2hB-WGjkVzs44Tp0oFJBZ4iYkBEgnl9vypmzXmkyKjD57zz2kx1Fx1b4qIgBvkTQ2N_QHQqsXsaAGfEuUjB-e6nA0K46qywj9rzQbAHQOSQHklZAI6pdeZ9MoZVW16LWOLo/s640/blog01.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">My blogdown blog at <a href="http://simecek.github.io/blog">http://simecek.github.io/blog</a></td></tr>
</tbody></table>
<br />
<br />
<h3>
1) Create a Github repository:</h3>
Go to your Github account, click the big green button "New Repository" and name your blog (it will later appear at http://USERNAME.github.io/BLOGNAME where BLOGNAME is a name of your repository).<br />
<br />
Do not create the "README" or "LICENCE" file. If you did, just delete it because blogdown requires to start with an empty directory and throws a message "Warning message: In blogdown::new_site() : The directory '.' is not empty" otherwise.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMOjkwM0j1dPOBZSkHrssQ8EjRUvDUnNgtHYbwpcEnPO0Hmyt2QUNLB4yQHfYNHbKWeXjN-4365o0AT0GxAY9UPDuVez_G89RdI2EmPXJ2DhuCdxxQvwQq35p4NuHvKWeH7yu2dL5OY3A/s1600/blog02.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="326" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMOjkwM0j1dPOBZSkHrssQ8EjRUvDUnNgtHYbwpcEnPO0Hmyt2QUNLB4yQHfYNHbKWeXjN-4365o0AT0GxAY9UPDuVez_G89RdI2EmPXJ2DhuCdxxQvwQq35p4NuHvKWeH7yu2dL5OY3A/s640/blog02.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New repository</td></tr>
</tbody></table>
<h3>
</h3>
<h3>
2) Create RStudio Project:</h3>
Open RStudio, select File -> New Project -> Version Control -> Git. Copy URL address from your browser (http://github.com/USERNAME/BLOGNAME) into Repository URL field. Click "Create Project" button.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5779vDcncXBDK0b-pvyytpkDc-cUzBeNk5JQhAtANjwDmu6IlXa-wrxeeEm7Dk3s37aLXn7E9oPOWNUB9pUNxcoFsQFHJVU4VEfjEbfuhy1M5wUF4ieAATP5fB9G6xXIZ1oE6fDy4cTQ/s1600/blog03.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5779vDcncXBDK0b-pvyytpkDc-cUzBeNk5JQhAtANjwDmu6IlXa-wrxeeEm7Dk3s37aLXn7E9oPOWNUB9pUNxcoFsQFHJVU4VEfjEbfuhy1M5wUF4ieAATP5fB9G6xXIZ1oE6fDy4cTQ/s400/blog03.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New RStudio project</td></tr>
</tbody></table>
<br />
<h3>
3) Install blogdown and create an empty skeleton</h3>
You can install blogdown from Github with devtools:<br />
<br />
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; overflow: auto; padding: 16px; word-break: normal; word-wrap: normal;"><span class="pl-e" style="box-sizing: border-box; color: #795da3;">devtools</span><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">::</span>install_github(<span class="pl-s" style="box-sizing: border-box; color: #183691;"><span class="pl-pds" style="box-sizing: border-box;">'</span>rstudio/blogdown<span class="pl-pds" style="box-sizing: border-box;">'</span></span>)</pre>
<br />
After that you might need to install HUGO, a platform that blogdown stands on, with <span style="background-color: rgba(0 , 0 , 0 , 0.0392157); color: #333333; font-family: "consolas" , "liberation mono" , "menlo" , "courier" , monospace; font-size: 13.6px;">blogdown::install_hugo().</span> Finally, a skeleton of a new blog can be generated by <span style="background-color: rgba(0 , 0 , 0 , 0.0392157); color: #333333; font-family: "consolas" , "liberation mono" , "menlo" , "courier" , monospace; font-size: 13.6px;">blogdown::new_site()</span>.<br />
<br />
<h3>
4) Customize config.toml file</h3>
Open the file "<span style="font-family: "courier new" , "courier" , monospace;"><a href="https://github.com/simecek/blog/blob/master/config.toml">config.toml</a></span>" and add a new line with <span style="font-family: "courier new" , "courier" , monospace;">publishDir = "docs</span>" (preferably somewhere at the beginning of the file). This makes your HTML page to be generated into "<span style="font-family: "courier new" , "courier" , monospace;">./docs</span>" folder and setting of your Github Pages will be later much easier. If you prefer hard ways, <a href="https://proquestionasker.github.io/blog/Making_Site/#initializing-github-pages-to-work-with-hugo-and-blogdown" target="_blank">Amber Thomas</a> and <a href="https://hjdskes.github.io/blog/deploying-hugo-on-personal-gh-pages/index.html" target="_blank">Jente Hidskes</a> describe how to keep default "<span style="font-family: "courier new" , "courier" , monospace;">publishDir</span>" and push the "<span style="font-family: "courier new" , "courier" , monospace;">./public</span>" folder into a branch with <span style="font-family: "courier new" , "courier" , monospace;">git subtree</span><span style="color: inherit; font-family: inherit; font-size: inherit;">.</span><br />
<br />
You might also want to add the links to your Twitter, Github... accounts, maybe even Google Analytics and Disqus.<strike> For Disqus, I did not manage to use a default template and was forced to create <a href="https://github.com/simecek/blog/blob/master/themes/hugo-lithium-theme/layouts/partials/disqus.html">my own version</a> of <a href="https://github.com/simecek/blog/blob/master/themes/hugo-lithium-theme/layouts/partials/footer.html">footer</a>.</strike> Solved - see <a href="http:/#update01">Update</a>.<br />
<br />
Finally, call <span style="background-color: rgba(0 , 0 , 0 , 0.0392157); color: #333333; font-family: "consolas" , "liberation mono" , "menlo" , "courier" , monospace; font-size: 13.6px;">blogdown::serve_site() </span>and view the blog. Any change you do immediately propagates into your RStudio viewer.<br />
<br />
If you do not like the default look, you can choose and customize a theme from <a href="http://themes.gohugo.io/" target="_blank">Hugo Theme gallery</a> (use <span style="background-color: rgba(0 , 0 , 0 , 0.0392157); color: #333333; font-family: "consolas" , "liberation mono" , "menlo" , "courier" , monospace; font-size: 13.6px;">blogdown::install_theme </span>function).<br />
<br />
<h3>
5) Commit Changes, Push Them to Github and Github Page Setting</h3>
Finally, go into your RStudio "Git" panel, select all files and commit them with and an appropriate message ("initial commit of my first blogdown blog, hurray!"). Of course, if you prefer git in a terminal to RStudio "Git" panel, you can commit and push to Github from a command line (<span style="font-family: "courier new" , "courier" , monospace;">git push -u origin master</span>).<br />
<br />
Next, you need to tell Github where to look for your Github pages. In the repo "Settings" (http://github.com/USERNAME/BLOGNAME/settings), find "GitHub Pages -> Source", select "master branch /docs folder" and push the "Save" button.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9pb_97DU7rXTuW-SmGzcrJ61Lke-S11bUk6q41iWaUyKf_7X31EN_CtzOuwVte7DeN-ejamXzF4BxMFOwtRQbLwlqzrqRwQW2PBbxwhzAeAm3MairS_eaPr9qxtoTazwQo0hMWwHarus/s1600/blog04.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="307" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9pb_97DU7rXTuW-SmGzcrJ61Lke-S11bUk6q41iWaUyKf_7X31EN_CtzOuwVte7DeN-ejamXzF4BxMFOwtRQbLwlqzrqRwQW2PBbxwhzAeAm3MairS_eaPr9qxtoTazwQo0hMWwHarus/s640/blog04.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Setting Github Pages</td></tr>
</tbody></table>
<h3>
6) Adding a content</h3>
Finally, your blog is online. You can access it at http://USERNAME.github.io/BLOGNAME.<br />
<br />
To add content use either new_post() function or RStudio add-in "New post" as shown on a figure below. Use format "R Markdown" if your post contains R code that needs to be run and "Markdown" otherwise. If you are new to markdown, Help -> Markdown quick reference (from RStudio menu) contains a lot of useful tips.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQP6WAnHUlS35e4J3oxelD7TJnYv5dMzC5PAjRgpROTWejhCZFJyhf1EdoTKhkkJjsAz2k4fNoXtr4rhP6FMgYPf8MrB0nevGwCSbqqHjhh319E9EL-o_86tgE2Vv-ouSk4yUkJ6UmhFA/s1600/figure05.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="406" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQP6WAnHUlS35e4J3oxelD7TJnYv5dMzC5PAjRgpROTWejhCZFJyhf1EdoTKhkkJjsAz2k4fNoXtr4rhP6FMgYPf8MrB0nevGwCSbqqHjhh319E9EL-o_86tgE2Vv-ouSk4yUkJ6UmhFA/s640/figure05.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New post addin</td></tr>
</tbody></table>
<br />
<a href="https://www.blogger.com/null" name="update01"><b>UPDATE 2/1/2016</b></a>: Regarding Disqus problem: it is caused by <span style="font-family: "courier new" , "courier" , monospace;">blogdown::serve_site()</span> function that ignores some settings in <span style="font-family: "courier new" , "courier" , monospace;">config.toml</span> file, namely <span class="" style="font-family: "courier new" , "courier" , monospace;">baseurl</span> option. If you want to use Disqus, set URL of your blog to <span class="" style="font-family: "courier new" , "courier" , monospace;">baseurl</span> and run <span style="font-family: "courier new" , "courier" , monospace;">blogdown<span style="font-family: "courier new" , "courier" , monospace;">::</span></span><span style="font-family: "courier new" , "courier" , monospace;">build_site(local=FALSE)</span><span style="font-family: inherit;"> </span><span style="font-family: inherit;">just before committing and pushing changes to Github. See </span><span style="font-family: "courier new" , "courier" , monospace;">build_site()</span><span style="font-family: inherit;"> </span><span style="font-family: inherit;">help for more information.</span><br />
<h3>
</h3>
Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com3tag:blogger.com,1999:blog-6208519949676270052.post-64564494713672759202017-01-26T21:18:00.002+01:002017-01-27T19:53:16.472+01:00Simple Personal Github Page (with Jekyll) I remember when I was creating <a href="https://simecek.github.io/" target="_blank">my first Github Page</a>. I was still quite new to git, did not understand branches and I was lost in Jekyll configuration. This step-by-step guide is intended for people in such situation that are, however, users of a) Github b) RStudio (if not, read <a href="http://happygitwithr.com/">this</a>).<br />
<br />
<h3>
1. Create Github Repository</h3>
<div>
Go to your Github account and click the big green button "New Repository", name your new repository USERNAME.github.io (for example <a href="https://github.com/simecek/simecek.github.io">simecek.github.io</a>).</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqG7kfKIQFDiL_5mdqUrcNZtcmXWP48Kc1Am81IFnEJFyTbSb4fUws6FKTdD123k0VesMmZyL83s67K0BQyKfy45z-ZTRtLiagtOIK2KWV4PsAmTpEiyssbyyiTw7BeAr0sOruQew4xOg/s1600/figure01.png" style="margin-left: auto; margin-right: auto;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqG7kfKIQFDiL_5mdqUrcNZtcmXWP48Kc1Am81IFnEJFyTbSb4fUws6FKTdD123k0VesMmZyL83s67K0BQyKfy45z-ZTRtLiagtOIK2KWV4PsAmTpEiyssbyyiTw7BeAr0sOruQew4xOg/s400/figure01.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New Github repo</td></tr>
</tbody></table>
<div>
<h3>
2. Create RStudio Project</h3>
</div>
<div>
Open RStudio, select File -> New Project -> Version Control -> Git. Copy URL address from your browser (http://github.com/USERNAME/USERNAME.github.io) into Repository URL field (see figure below). Click "Create Project" button.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTzq3AKDiVMZ83loGXvo6ooggwZRSzrE1DU96Ycgp6El13lGPWV-CIV_4fNGzgfa0G3RHVldsv0QrQm9I3wli5ICFdxDVBcgzkd20GlskWUsWBElJjiX8OqHtw0TOeP1QGhcyRqR3dGek/s1600/figure02.png" style="margin-left: auto; margin-right: auto;"><img border="0" height="281" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTzq3AKDiVMZ83loGXvo6ooggwZRSzrE1DU96Ycgp6El13lGPWV-CIV_4fNGzgfa0G3RHVldsv0QrQm9I3wli5ICFdxDVBcgzkd20GlskWUsWBElJjiX8OqHtw0TOeP1QGhcyRqR3dGek/s400/figure02.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New version controlled project</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
Locate the folder (USERNAME.github.io) on a disk. You will need it in the following step.</div>
<div>
<br /></div>
<div>
<h3>
3. Select and Customize Jekyll Template</h3>
</div>
<div>
If you wish, you can use any static web page as your Github Page. For example, you can just have a <a href="https://github.com/simecek/simecek.github.io/blob/922456cce101d2bae185994fe6fe3ffa8a1b684a/index.html" target="_blank">redirecting script</a>. Here, I will show how to build a simple landing page with <a href="https://jekyllrb.com/" target="_blank">Jekyll</a>.</div>
<div>
<br /></div>
<div>
First of all, select a template you want to use, for example from <a href="http://jekyllthemes.org/">http://jekyllthemes.org/</a>. </div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGev4Y6-Dg53XMpSG4o8Wc8U381I2LLCUC-NhlPuXkpxkjdzY8Uu9jIgDoGAqnwu46u9JUr-MsC-oqZuLmK-2rysMH9yQC9WOxTDYU7OoP8YkaLslTEQofRvnI4aTaNb3Yqc1fTG2ZOsI/s1600/figure03.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGev4Y6-Dg53XMpSG4o8Wc8U381I2LLCUC-NhlPuXkpxkjdzY8Uu9jIgDoGAqnwu46u9JUr-MsC-oqZuLmK-2rysMH9yQC9WOxTDYU7OoP8YkaLslTEQofRvnI4aTaNb3Yqc1fTG2ZOsI/s400/figure03.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Jekyll Themes gallery</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<br /></div>
<div>
Save and extract template ZIP file into your RStudio project folder USERNAME.github.io, so it should now look something like <a href="https://github.com/simecek/simecek.github.io" target="_blank">this</a> (the folder on a disk, NOT yet Github repository).</div>
<div>
<br /></div>
<div>
Read extracted README file. Typically, you need to customize <span style="font-family: "courier new" , "courier" , monospace;">_config.yml</span> and <span style="font-family: "courier new" , "courier" , monospace;">index.html</span> files. The page itself is generated by Jekyll (ruby gem). Github supports Jekyll, so you might let generation of the actual HTML pages on him.</div>
<div>
<br /></div>
<div>
<h3>
4. Commit Changes and Push Them to Github</h3>
</div>
<div>
Finally, go into your RStudio "Git" panel, select all files and commit them with and an appropriate message ("initial commit of my first Github Page, hurray!").</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtO-FZvZ4K_lPGGWNaEUJ-QVeWBs6iFddt-KNrPaENnAKwwZbaNyvPLJM_VziyJ8LL0MRgF0U5O6__NDTKglprCZsLSzt8SvXzdDHRNfFJYb4Tdw30xMU1htSe5g2vFi_f6LqcgaSTA8Q/s1600/figure04.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="363" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtO-FZvZ4K_lPGGWNaEUJ-QVeWBs6iFddt-KNrPaENnAKwwZbaNyvPLJM_VziyJ8LL0MRgF0U5O6__NDTKglprCZsLSzt8SvXzdDHRNfFJYb4Tdw30xMU1htSe5g2vFi_f6LqcgaSTA8Q/s400/figure04.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Git panel is just next to Environment and History</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<br /></div>
<div>
You might want to check that Github Pages are turned on in your repo's setting (https://github.com/USERNAME/USERNAME.github.io/settings). You might need to wait for a minute or two before the page is generated. Do not like it? Modify - commit - push (- make a tea - rinse - and repeat).</div>
Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com1tag:blogger.com,1999:blog-6208519949676270052.post-73462797278020982852016-07-14T23:16:00.000+02:002016-10-05T16:25:21.540+02:00One more reason to use FeatherIt was quiet here for some time. Not because I have nothing to blog but because I have no time to do so properly. One of those almost forgotten posts was about Feather package / module.<br />
<br />
Feather is a fast, lightweight binary format for data frames with R and Python implementation. The original RStudio announcement is <a href="https://blog.rstudio.org/2016/03/29/feather/">here</a>. And sure, the speed improvement is impressive. See my numbers for saving ~ 100 million probabilities:<br />
<br />
<div class="MsoNormal">
<span style="font-family: "courier new";"># haplotype probs: 192 animals x 8 x 64000 markers<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "courier new";">> format(object.size(probs), units="Mb")<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "courier new";">[1] "750 Mb"</span><span style="font-family: "calibri" , "sans-serif";"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "courier new";"># saveRDS or save needs almost a minute to write probs to disk<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "courier new";">> system.time(saveRDS(dprobs, file="DO192_probs.rds"))<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "courier new";"> user system elapsed<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "courier new";"> 50.701 0.574 51.678<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "courier new";"># write_feather needs 6-7 seconds<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "courier new";">> system.time(write_feather(dprobs, file="DO192_probs.feather"))<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "courier new";"> user system elapsed</span><span style="font-family: "courier new";"> </span><br />
<span style="font-family: "courier new";"> 1.344 1.051 6.272</span></div>
<br />
Feather is even better if you compare it to traditional text formats like CSV. As David Smith explains in <a href="http://blog.revolutionanalytics.com/2016/05/feather-package.html">his blog</a>, one of the reasons is traditional formats are row-oriented while internal R's storage is column-oriented.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU-K-h9fXfTg7b1orgRI9xOp1C6pUBUg0G1OlaVw1JCgT8jehBX3QthWs5-BC_iD7Q7qrznSlYFyQng16dWEl24PsU0LXpvo1ICuZEvdV6LYbCZjls-8HDbxbDUNPo469lhPFfJodNklU/s1600/6a0105360ba1c6970c01b7c8616f0e970b-800wi.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="307" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU-K-h9fXfTg7b1orgRI9xOp1C6pUBUg0G1OlaVw1JCgT8jehBX3QthWs5-BC_iD7Q7qrznSlYFyQng16dWEl24PsU0LXpvo1ICuZEvdV6LYbCZjls-8HDbxbDUNPo469lhPFfJodNklU/s400/6a0105360ba1c6970c01b7c8616f0e970b-800wi.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Diagram credit: Hadley Wickham</td></tr>
</tbody></table>
<br />
I have<b> one more reason</b> to use Feather. If you have datasets with many columns (e.g. genes in human/mouse genome) and you need fast access to just one column (e.g. Shiny app), then Feather is ideal because its columns are automatically indexed.<br />
<br />
<div class="MsoNormal">
<span style="font-family: "courier new";">read_feather("DO192_probs.feather",
column = "19_48310898")</span><o:p></o:p></div>
<div class="MsoNormal">
<span style="font-family: "courier new";">
user system elapsed<o:p></o:p></span></div>
<span style="font-family: "courier new"; font-size: 12.0pt;"> 0.068 0.000 0.069</span><br />
<span style="font-family: "courier new"; font-size: 12.0pt;"><br /></span>
Sure, there are other solutions, like <a href="http://bioconductor.org/packages/release/bioc/html/rhdf5.html">rhdf5</a> or <a href="https://cran.r-project.org/web/packages/RSQLite/index.html">RSQLite</a>, but Feather is the easiest to use, at least for me, at least in R. See David Smith (Microsoft R) for more details: <a href="http://blog.revolutionanalytics.com/2016/05/feather-package.html">http://blog.revolutionanalytics.com/2016/05/feather-package.html</a><br />
<br />Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0tag:blogger.com,1999:blog-6208519949676270052.post-47778626577074426882015-05-20T23:54:00.002+02:002017-01-27T19:19:19.826+01:00Teaching R course? Use analogsea to run your customized RStudio in Digital Ocean!Two years ago I taught an introductory R/Shiny course here at The Jackson Lab. We all learnt a lot. Unfortunately not about Shiny itself, but rather about incompatibilities between its versions and trouble with its installation to some machines.<br />
<br />
And it is not only my experience. If you look into forums of <a href="https://courses.edx.org/courses/HarvardX/PH525.1x/1T2015/info">Rafael Irizarry MOOC courses</a>, so many questions are just about installation / incompatibilities of R packages. The solution exists for a long time: run your R in a cloud. However, customization of virtual machines (like Amazon EC2) used to be a nontrivial task.<br />
<br />
In this post I will show how a few lines of R code can start a customized RStudio docklet in a cloud and email login credentials to course participants. So, the participant do not need to install R and the required packages. Moreover, it is guaranteed they all run exactly the same software. All they need is a decent web browser to access RStudio server.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyr47tt-fsFAQY5-7ruM62qCy31TQ-bmfDyiOeubfHBLpgusTtpo91IlBWnUPZQTkQLCgIKt9CmxaQFstbb7Rye4xlkj_MIsgR7uK141CSApQ7lXnjwRKZDJMLv6qBHrPlZ7cibqv-6d0/s1600/pagescreen.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyr47tt-fsFAQY5-7ruM62qCy31TQ-bmfDyiOeubfHBLpgusTtpo91IlBWnUPZQTkQLCgIKt9CmxaQFstbb7Rye4xlkj_MIsgR7uK141CSApQ7lXnjwRKZDJMLv6qBHrPlZ7cibqv-6d0/s320/pagescreen.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">RStudio server login</td></tr>
</tbody></table>
<br />
<h3>
Running RStudio in Digital Ocean with R/analogsea</h3>
So how complicated is it today to start your RStudio on clouds? It is (almost) a one-liner:<br />
<ol>
<li>If you do not have Digital Ocean account, get one. You should receive a promotional credit $10 (= 1 regular machine running without interruption for 1 month):<br /><a href="https://www.digitalocean.com/?refcode=673c97887267">https://www.digitalocean.com/</a><br />(full disclosure: if you create your account using the link above I might get an extra credit)</li>
<li>Install <a href="https://github.com/sckott/analogsea">analogsea</a> package from Github. Make sure to create Digital Ocean <a href="https://cloud.digitalocean.com/settings/tokens/new">personal access token</a> and in R set <span style="background-color: rgba(0 , 0 , 0 , 0.0392157); color: #333333; font-family: "consolas" , "liberation mono" , "menlo" , "courier" , monospace; font-size: 13.6000003814697px; line-height: 21.7600002288818px;">DO_PAT </span>environment variable. Also create your personal SSH key and upload it to <a href="https://cloud.digitalocean.com/settings/security">Digital Ocean</a>.</li>
<li>And now it is really easy:<br /><br /><span style="font-family: "courier new" , "courier" , monospace;">library(analogsea)<br /># Sys.setenv(DO_PAT = "*****") set access token<br /><br /># start your machine in Digital Ocean<br />d <- docklet_create(size = getOption("do_size", "512mb"))<br /># run RStudio on machine 'd' (rocker/rstudio docker image)<br />d %>% docklet_rstudio()</span></li>
</ol>
<span style="font-family: inherit;">The last line should open your browser with RStudio login page (user "rstudio", password "rstudio"). If not, use </span><span style="font-family: "courier new" , "courier" , monospace;">summary(d)</span><span style="font-family: inherit;"> to get the IP address of your machine and go to </span><span style="font-family: "courier new" , "courier" , monospace;">http://your_machine:8787</span><span style="font-family: inherit;">. </span><br />
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
It will cost you ~$0.01 per hour ($5 per month, May 2015). <span style="font-family: inherit;">When you are done, do not forget to stop your Digital Ocean machine (</span><span style="font-family: "courier new" , "courier" , monospace;">droplet_delete(d)</span><span style="font-family: inherit;">). At the end, make sure that you </span>successfully killed all your machines - either log in to <a href="https://cloud.digitalocean.com/droplets">Digital Ocean</a> or by calling <span style="font-family: "courier new" , "courier" , monospace;">droplets()</span> in R.<br />
<a name='more'></a></div>
<div>
<br /></div>
<h3>
Customized RStudio images</h3>
<div>
What if the default RStudio image is not good enough for you because you insist that your package needs to be pre-installed. For example, your package has many dependencies, like <a href="http://www.bioconductor.org/packages/release/bioc/html/DOQTL.html">DOQTL</a>, that needs long time to be downloaded (org.Hs.eg.db, org.Mm.eg.db, ...).</div>
<div>
<br /></div>
<div>
You can still use analogsea to run your Digital Ocean machines but in advance you need to prepare your own customized docker image. First create an account on <a href="http://docker.com/">Docker.com</a> and get yourself introduce to <a href="https://docs.docker.com/articles/dockerfile_best-practices/">Dockerfile syntax</a>. Then link your Docker account to your Github as <a href="https://docs.docker.com/docker-hub/builds/">described here</a>.<br />
<br />
I has been afraid of that because my knowledge of docker is somehow limited. It was actually far easier than I expected: See a dockerfile for RStudio with DOQTL pre-installed.<br />
<br />
<script src="https://gist-it.appspot.com/github/simecek/doqtl_docker/blob/master/Dockerfile"></script>
<br />
Also, see <a href="https://github.com/rocker-org/hadleyverse/blob/master/Dockerfile">Dockerfile</a> of <a href="https://github.com/rocker-org/hadleyverse">rocker/hadleyverse</a> image with Hadley Wickham's packages preinstalled to get more inspiration.<br />
<br /></div>
<div>
<h3>
Start virtual machine, pull and run customized RStudio image, email credintials</h3>
</div>
<div>
Finally, suppose you created your customized docker image (like <a href="https://registry.hub.docker.com/u/simecek/doqtl-docker/dockerfile/">simecek/doqtl-docker</a>). For each participant of your course, you want to start a virtual machine, pull this image, run it and email IP (and credentials) to the participant.<br />
<br />
The code below is doing just that. There are several ways to send emails in R and this program utilizes sendmailR package. I split the code into several for-loops, so if something goes wrong there is a better chance to catch it.<br />
<br />
<br /></div>
<script src="https://gist.github.com/simecek/d3600620314ca5421846.js"></script>
<br />
<h3>
Final thoughts and links</h3>
<div>
Docker can be installed to <a href="https://docs.docker.com/installation/">many systems</a> (including Windows). So, the course participants should be able to use your customized RStudio image even after the end of the course on their own servers or laptops. Another advantage is a fully reproducible code - R syntax will change, packages will come and go but your docker image will be functional as long as some docker client will exist.</div>
<div>
<br /></div>
<div>
If you feel overwhelmed and all you need is to run RStudio in the cloud (no analogsea, no customization), I would recommend <a href="http://sas-and-r.blogspot.com/2014/12/rstudio-in-cloud-for-dummies-20142015.html">RStudio in the cloud for dummies, 2014/2015 edition</a> as a good start and a tool sufficient for the most of practical applications.</div>
<div>
<br /></div>
<div>
Of course, teaching R course is not the only reason to run R on Digital Ocean. I started my first droplet 3 month ago to host my Shiny apps. Digital Ocean gives you for $5-$10/month similar functionality as shinyapps.io for $99/month. If interested, see <a href="http://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/">How to get your very own RStudio Server and Shiny Server with DigitalOcean</a>.<br />
<br />
<br />
<b>UPDATE 10/14/2015</b>: We used Docker / Digital Ocean for teaching Short Course on Systems Genetics. All data, scripts (incl. data transfer, printing DO machine table and emailing participants) and 3 docker images are available at<br />
<br />
<a href="https://github.com/churchill-lab/sysgen2015">https://github.com/churchill-lab/sysgen2015</a><br />
<br />
<b>UPDATE 9/9/2015</b>: We used Docker / Digital Ocean for a tutorial of kallisto, DOQTL, Deseq2. All materials available at </div>
<div>
<br />
<a href="https://github.com/churchill-lab/AddictionCourse2015">https://github.com/churchill-lab/AddictionCourse2015</a></div>
<div>
</div>
Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com2tag:blogger.com,1999:blog-6208519949676270052.post-57270990261052940462015-02-11T16:43:00.000+01:002017-01-27T19:17:23.224+01:00Make your R plots interactiveTHIS POST IS NOW OBSOLETE, USE PLOTLY OR GGIRAPH, SEE MY <a href="https://simecek.github.io/blog/2017/01/26/interactive-graphs-with-plotly-and-ggiraph-packages/" target="_blank">CODE EXAMPLE</a><br />
<br />
As a part of my daily job, I draw scatterplots, lots of them. And because there are thousands of genes expressed in any mouse or human tissue, my typical plot looks something like this (<a href="https://gist.github.com/simecek/6f8d41a6d0c71bebbe12">code</a>). (Actually, it is a comparison of variance that can be attributed to "sex" factor in mRNA vs. protein expression.)<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWuA9iKSyZxG7fW3bxX-EP5aFmcNnCiJyve7gv-T_QYkEUH17Ukq8aGjv84SqIp82d5AhW1iuiIkcBvGwipODV4Z0xmFiJn53fSiHppw8gphXVJcVNFD9WuntYhR1AnO3oUlThe4iwNnU/s1600/scatterplot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWuA9iKSyZxG7fW3bxX-EP5aFmcNnCiJyve7gv-T_QYkEUH17Ukq8aGjv84SqIp82d5AhW1iuiIkcBvGwipODV4Z0xmFiJn53fSiHppw8gphXVJcVNFD9WuntYhR1AnO3oUlThe4iwNnU/s640/scatterplot.png" /></a></div>
<br />
The question is - what is a gene in the top right corner? And what is the one next to him? And this one? And that?<br />
<a name='more'></a><br />
<br />
What we need is a clickable scatterplot. Something I can point with a mouse and get a corresponding gene name. Then click and my browser would open a window with the gene's details (for example in <a href="http://www.ensemble.org/">Ensemble</a>). And thanks to <a href="https://github.com/rstudio/ggvis">ggvis</a> package, it is now possible. Try the following code:<br />
<br />
<script src="https://gist.github.com/simecek/8a837633d86219ee12fa.js"></script>
<br />
In the case above there must be R running somewhere behind, translating points to gene symbols and Ensemble links. How to share this figure with somebody who does not have R on his or her machine? One possibility is to run it on <a href="http://shinyapps.io/">shinyapps.io</a> or your private shiny server.<br />
<br />
The second way to add interactive annotation is <span style="font-family: "courier new" , "courier" , monospace;">iplot</span> function in the new Karl Broman's interactive <a href="https://github.com/kbroman/testjs">testjs</a> package. It produces Javascipt widget that can be easily saved and share as html page (<a href="https://gist.github.com/simecek/708225c21ed8b41fc7ba">code</a>).<br />
<br />
<br />
<div style="text-align: center;">
And with a little help of <a href="https://github.com/rstudio/shiny">shiny</a>, we can do even more: Mike Love has a nice example (mtcars_demo in his <a href="https://github.com/mikelove/shinyMA">Github repository</a>), s<span style="font-family: inherit;">ee the widget below. Click on a dot in the left panel makes the corresponding dot in the right panel highlighted (the trick is</span> <span style="font-family: "courier new" , "courier" , monospace;">clickId</span> option in <span style="font-family: "courier new" , "courier" , monospace;">shiny::plotOutput)</span>.</div>
<br />
<br />
Mike's approach is similar to<span style="font-family: "courier new" , "courier" , monospace;"> identify </span>function in basic graphics. The output is a position on an image and you need to find the nearest point afterwards.<br />
<br />
I tried something similar with ggvis's SVG objects, so you can set up "on_click" or "on_hoover" events directly (see mtcars_demo <a href="https://github.com/simecek/small_shiny_projects">here</a>). Click either on left or right panel and the corresponding dot in the opposite panel gets highlighted.<br />
<br />
<br />
<iframe height="400px" src="https://simecek.shinyapps.io/mtcars_demo/" width="100%"></iframe>
<br />
<br />
<br />
For more complex visualisations, D3.js is a must. However, if you just need to add a bit of interactivity to your R plots, thanks to ggvis, shiny, htmlwidgets, ... it is now possible.<br />
<br />
PS. Matt Sundquist sent me the first graph made by <a href="http://www.r-bloggers.com/interactive-2d-3d-plots-with-plotly-and-ggplot2/">plotly</a> that is very cool. More about that maybe later. The trick to edit "on_hover" text is described <a href="http://stackoverflow.com/questions/26102941/using-2-legends-from-r-to-plotly-plot-ly">here</a>.<br />
<br />
<br />
<div>
<a href="https://plot.ly/~MattSundquist/7475/" style="display: block; text-align: center;" target="_blank" title="Variability Explained by Sex"><img alt="Variability Explained by Sex" onerror="this.onerror=null;this.src='https://plot.ly/404.png';" src="https://plot.ly/~MattSundquist/7475.png" style="max-width: 100%; width: 1146px;" width="1146" /></a>
<script async="" data-plotly="MattSundquist:7475" src="https://plot.ly/embed.js"></script>
</div>
Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com2tag:blogger.com,1999:blog-6208519949676270052.post-83268241175586965332014-11-05T02:11:00.000+01:002017-01-27T19:13:56.114+01:00Tweeting at #IMGC14 conferenceThe 28th annual <a href="http://imgs.org/?run=conference">International Mammalian Genome Conference</a> was held over the last week in Bar Harbor, MA. For the first time, the official conference hashtag #IMGC14 was introduced. Twitter shares plummeted 9% next day. Pure coincide? I do not think so!<br />
<br />
Totally, 79 participants contributed 1546 tweets. Guess who was the <a href="https://twitter.com/stevemunger">Twitter evangelist</a>?<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJZoefFIZMgMjI105UFPKE3TaBQHyL6Kq3KbPDTfnC3-5_C2zhKWgxi6A9iIQUw5RrJjqAnLSdQZzxIzQYP9Cn0b4WDhGWW9Bku_-UBx7yYSOqE1mzAbD9_ghEYvxq5pmgPP_oP_MGmI0/s1600/users.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJZoefFIZMgMjI105UFPKE3TaBQHyL6Kq3KbPDTfnC3-5_C2zhKWgxi6A9iIQUw5RrJjqAnLSdQZzxIzQYP9Cn0b4WDhGWW9Bku_-UBx7yYSOqE1mzAbD9_ghEYvxq5pmgPP_oP_MGmI0/s1600/users.jpeg" width="514" /></a></div>
<br />
The distribution of tweets in time reveals when the lobster was served as a conference dinner.<br />
<a name='more'></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3I6k9_6VHib8xTODG9BhKaxzWJ4jH1K094n3hokq2XWltrLOzvewQMv59JE3iyRgJkRwomoCuzQPMyF_-V9gleI9f-LIH5xOJsdxJGDlnOCYhzoTCj4cm6ITatsldSrP52UHXSjpDUf4/s1600/intensity.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="424" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3I6k9_6VHib8xTODG9BhKaxzWJ4jH1K094n3hokq2XWltrLOzvewQMv59JE3iyRgJkRwomoCuzQPMyF_-V9gleI9f-LIH5xOJsdxJGDlnOCYhzoTCj4cm6ITatsldSrP52UHXSjpDUf4/s1600/intensity.jpeg" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
The most retweeted status was <a href="https://twitter.com/drtkeane">Thomas Keane</a>'s announcement about the new strains in Mouse Genomes Project:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFeWzjsDQWEgjp252xuQun9F46iTbMve-JuQhQeMpxnh-sC6jcViRLRiPJ7kGZ4t37BP1YzH2iRbAH3alkDkuDmA-wRCBoWCfzV9BtaCl-9ZDAS7FFwzgt_1aY38CUZIkjuuISmFhgujs/s1600/mostRT.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFeWzjsDQWEgjp252xuQun9F46iTbMve-JuQhQeMpxnh-sC6jcViRLRiPJ7kGZ4t37BP1YzH2iRbAH3alkDkuDmA-wRCBoWCfzV9BtaCl-9ZDAS7FFwzgt_1aY38CUZIkjuuISmFhgujs/s1600/mostRT.jpg" width="400" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
The most favorited status was <a href="https://twitter.com/grebmot/status/527200223312240640/photo/1">Kärt Tomberg</a>'s typo:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy_lHnpb_TrbF4OZfTnOqe4ZwqIQIMxBL2PiJCze1fQnpT08Dyy9OqKXZlkXGNbTeu9dWs2fAJgC3Z2DP3KM5xRCC5ebNnBW20MxZ3QpmXn6Obv0Pelzhd1a8jyvyJrp48dBh7ZlNyqdQ/s1600/mostFAV.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="427" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy_lHnpb_TrbF4OZfTnOqe4ZwqIQIMxBL2PiJCze1fQnpT08Dyy9OqKXZlkXGNbTeu9dWs2fAJgC3Z2DP3KM5xRCC5ebNnBW20MxZ3QpmXn6Obv0Pelzhd1a8jyvyJrp48dBh7ZlNyqdQ/s1600/mostFAV.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
And finally, this is the #IMGC14 wordcloud. It was a great time. Thank you all! By the way, my official Twitter account is "<a href="https://twitter.com/simecek42">simecek42</a>".</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhuXiYcoW3BzXPc7ikHjg3a-Kyxsw1kC7UEbaqh6C_JZCwBGO5t8dZQdaT55lBc5I7iq305jpkK44vmtYZH1BkxWK9uP-ERl7drJG41pfSWaEVhC4ytcdamoeNYUgjvz97sSdEP1VJIFs/s1600/wordcloud.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhuXiYcoW3BzXPc7ikHjg3a-Kyxsw1kC7UEbaqh6C_JZCwBGO5t8dZQdaT55lBc5I7iq305jpkK44vmtYZH1BkxWK9uP-ERl7drJG41pfSWaEVhC4ytcdamoeNYUgjvz97sSdEP1VJIFs/s1600/wordcloud.jpeg" width="514" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Data were downloaded from Twitter as described <a href="http://thinktostart.com/twitter-authentification-with-r/">here</a>. For figures, use the following R code:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>
<div>
<br />
<script src="https://gist.github.com/simecek/ba8a9b386ff21a501eb8.js"></script>
</div>
Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0tag:blogger.com,1999:blog-6208519949676270052.post-83659750559055663242014-05-13T05:54:00.000+02:002014-05-15T15:43:18.541+02:00RStudio: Pushing to Github with ssh-authenticationIf <a href="https://www.rstudio.com/ide/docs/version_control/overview" target="_blank">RStudio</a> prompts you for a username and password every time you try to push your project to <a href="http://rogerdudler.github.io/git-guide/" target="_blank">Github</a>, open the shell (Git menu: More/Shel...) and do the following:<br />
<br />
1) Set username and email (if you did not do that before)<br />
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><span style="background-color: transparent; font-family: 'Courier New', Courier, monospace;">git config --global user.name "your_username"
</span><span style="font-family: 'Courier New', Courier, monospace; font-size: small; line-height: normal; white-space: normal;">git config --global user.email "your_email@example.com"</span><span style="background-color: transparent; font-family: 'Courier New', Courier, monospace;">
</span></pre>
<div>
<br /></div>
2) Create SSH key<br />
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><span style="background-color: transparent; font-family: 'Courier New', Courier, monospace;">ssh-keygen -t rsa -C "your_email@example.com" </span></pre>
<div>
<br />
In RStudio, go to menu Tools / Global options / Git SVN / View public key and copy the key to your <a href="https://github.com/settings/ssh">Github account setting</a> (Edit profile / SSH keys / Add SSH key).<br />
<br /></div>
To check that ssh-authentication works, try to run<br />
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">ssh -T git@github.com</code></pre>
<br />
and you should get something like<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><i>Hi your_username! You've successfully authenticated, but GitHub does not provide shell access. </i></span><br />
<br />
<b>3) Change remote.origin.url from HTTPS to HTTP </b><br />
<br />
It might be Windows specific, but after 1)+2) RStudio still asks me for user name and password. After a long Google search, I have found a solution <a href="http://stackoverflow.com/questions/1595848/configuring-git-over-ssh" target="_blank">here</a> and that is<br />
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">git config remote.origin.url git@github.com:your_username/your_project.git</code></pre>
<br />
<b><i>Hip, Hip, Hurrah!</i></b><br />
<b><i><br /></i></b>
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxQQEBUUEBIUFRUVFRoVFxQVFBUUFxQSFxQYFhQUFxQYHSggGBolHBUUITEhJSkrLi4uFx8zOD8sNygtLisBCgoKDg0OGxAQGi0mHSQtLCwsLCw0LCwsLywsLCwsLCwsLCwsLCwsLCwsLCssLCwsLCwsLCwsLCwsNyw3LDcsK//AABEIAOEA4QMBIgACEQEDEQH/xAAcAAEAAQUBAQAAAAAAAAAAAAAABQEEBgcIAwL/xABTEAABAwICBQgCDAkICwEAAAABAAIDBBEFIQYHEjFREzJBYXGBkaEis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Tw7Zt0dK1/wCesxm3KleotTtXhGav4KyOnc2vkD3Bw5P0tpzWWzDnWzz3bysoXxHGGiwC+1EREcMrW3TlVjyDcGx4hTOHYltHZfv6Dx+9QqAqt6RZfT1LUnsy5VXxEchffZfa4XrQIiICIiAiIgIiICIiAhREFhidDyguOcPPqUBIwtNnCxHQVlq8p6Zrx6QB9Y71rTVmvaXNrdPF+8csWRS0+De8d3O+0Kxlont3tPdn6l0xqVniXFbRvXmEfX8zvCjVJV/M71Grpp+WS4rm2cDxCpRvs8deS9MQ3t7F4U/Pb2hTH5HrXvu63D1lfFI27x4+CrW8893qX1Qc/uKj+I8Jece0+tXmHDI9qs5Oce0+tXmHbj2/Ul/yLxF6RwOdzWk931q8hwh55xDR4lc03rHlpXTtbiEepLDcOLiHPFgNw4/cpGmw5kedrniVdgLC+tntDr0umx3sKqIsHYIiICIiAiIgIiICIiAiIgIiIKFFVEHnJE13OaD2gFWkmEQu3xN7svUr9FMTMcSrNYnmEZPgcL97TlwcV4t0dhBBG3l+t9ymUVvkv7VnRpPhDyaPRONzt/xfcvuHAIWm4Du9xUqifLf2j4dP1CObgkAN+TB7ST6yrqGkYzmsaOwAL3RVm1p5leKVjiFLIqooWEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERB/9k=" /><br />
<br />
If it was trivial for you, I do apologize. I am still very bad in guessing what could be <a href="http://applyr.blogspot.com/2012/01/mining-facebook-data-most-liked-status.html" target="_blank">useful for somebody</a> and what not so much. That is why I have this blog and Github account in the first place.<br />
<br />
One example, last year I published <a href="http://www.sciencedirect.com/science/article/pii/S037837581200239X" target="_blank">a paper</a> in JSPI journal that improves a test for interaction in some very specific 2-way ANOVA situation (just one observation per group). The paper submission was an odyssey, mostly because of me. In one moment I doubted whether to retract the paper or not and I even did not upload the package to CRAN at first, just put it on <a href="https://github.com/simecek/additivityTests" target="_blank">Github</a>.<br />
<br />
Then I discovered that some guys found it and had built their package using it. They presented the results at <a href="http://www.edii.uclm.es/~useR-2013/abstracts/files/95_abstract.pdf" target="_blank">UseR! 2013 conference</a>. I might have met one of <a href="http://www.sciencedirect.com/science/article/pii/S0961953413004960" target="_blank">those biologists</a> but I am sure I never mentioned my package to them. Finally, - and this is a bit embarrassing - I received an email from Fernando Tusell that I misspelled his name in one of my functions.<br />
<br />
In summary, even if you see your work as non-essential from your perceptive, the others may have different view. Just do your best and share your results. Github is a perfect place for this.<br />
<br />
<br />Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com8tag:blogger.com,1999:blog-6208519949676270052.post-76714374886503598562014-01-01T17:33:00.000+01:002015-03-18T00:20:25.855+01:00Shiny Year 2014<a href="http://glimmer.rstudio.com/simecek/pf2014en/">http://glimmer.rstudio.com/simecek/pf2014en/</a> (source on <a href="https://github.com/rakosnicek/small_shiny_projects" target="_blank">Github</a>)<br />
<br />
"Pour Felicitér" is a French phrase used by Czech and Slovak to wish a happy new year, but not in French speaking countries. It is dating back to the beginning of 19. century when French was popular in Czech/Austrian city population similar way as English is today.<br />
<br />
I originally wanted to make it a snow flake to share a plenty of snow we have in Maine. But then I discovered this <a href="http://wiekvoet.blogspot.com/2013/12/merry-christmas.html" target="_blank">Xmas R post</a> and made it Shiny.<br />
<br />
Let your 2014 be shiny as well!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTbgFW2lgNgwZY9MU_A2aNm8nRwOyh1zmjBoGWENhGUs-562KZszmKEhu9EDo8r76Vq96zyp5jjzq24bdnvbyrZpaPSILDSYLoQirdLRuYL2BntOcnLg_d-HziYV8QW_BcDuGXBDchySo/s1600/tree.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTbgFW2lgNgwZY9MU_A2aNm8nRwOyh1zmjBoGWENhGUs-562KZszmKEhu9EDo8r76Vq96zyp5jjzq24bdnvbyrZpaPSILDSYLoQirdLRuYL2BntOcnLg_d-HziYV8QW_BcDuGXBDchySo/s400/tree.png" height="400" width="337" /></a></div>
<br />Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com1tag:blogger.com,1999:blog-6208519949676270052.post-68911656752829958432013-09-23T23:00:00.000+02:002017-01-27T19:13:10.731+01:00The Kaufman Decimals<a href="http://mathwithbaddrawings.com/2013/08/13/the-kaufman-decimals/" target="_blank">In his brilliant post</a> (read it!), Ben Orlin introduced Kaufman decimals as follows, if<br />
<br />
<b>0.(4) = 0.444444444444444444444444444444444444444</b>....,<br />
<br />
is a number where the fourths go on forever, then<br />
<br />
<b>0.(4)<span style="background-color: yellow;">1</span> = 0.44444444444444444444444444444444444444....<span style="background-color: yellow;">1</span></b>,<br />
<br />
is a number where the fourths go on forever <span style="background-color: yellow;">and, afterwards, there’s a one</span>.<br />
<br />
Imagine writing the number <b>0.(4)<span style="background-color: white;">1</span><span style="background-color: white;"> </span></b>into a grid. You fill the first line with fourths and then write "1" into the second line like this<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLWtD3HoG8QK_gcnvrhBihWlBt2KtKr5YMvXCMaRHAst4ZRjqFlrBzcT_Q4VUGQFtPCx9AHdMOF1eVOJy_KTQiiLazlMRpQsOICSWP-_9MPuNvbhrvVqhjDxIUFQYSvS1PgzgiA0frdLw/s1600/number41.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLWtD3HoG8QK_gcnvrhBihWlBt2KtKr5YMvXCMaRHAst4ZRjqFlrBzcT_Q4VUGQFtPCx9AHdMOF1eVOJy_KTQiiLazlMRpQsOICSWP-_9MPuNvbhrvVqhjDxIUFQYSvS1PgzgiA0frdLw/s320/number41.gif" width="320" /></a></div>
<a name='more'></a><br />
<br />
Obviously, <b>0.(4) </b>equals <b>0.(44)</b> or <b>0.(444)</b> (=one line of 4s) but not <b>0.(4)(4) </b>(=two lines of 4s). For complex decimals with repetitions of repetitions, like <b>0.(1(2(3)))((4))56</b>, you need N-dimensional grid, but the principle is analogous.<br />
<br />
Ben asked the question whether Kaufman decimals can be totally ordered. Sure - just look for the first digit that differs. To do this precisely, one needs ordinal indices - Mariano Chouza provides a <a href="http://mchouza.wordpress.com/2013/08/25/kaufman-decimals/" target="_blank">proof on his blog</a>. It has been a long time since I have seen a set-theory stuff like this. I more or less guess than really understand it but the main idea is easy to comprehend.<br />
<br />
So, how to compare Kaufman decimals on a computer? Jeff Kaufman upload <a href="https://github.com/jeffkaufman/decimals/blob/ba04ac7c8ab84ab7c8c6db05f9bb04e48ffcbaa4/decimal.py" target="_blank">some Python code</a> to Github that is not really working (0.(81)>0.89 and other issues). I cloned his project and here is <a href="https://github.com/rakosnicek/decimals" target="_blank">my own attempt</a>:<br />
<ol>
<li>The first difference matters. So I implemented "split" function that returns the first omega^k digits (k=0 one digit, k=1 a line, k=2 plane, ...) and the rest of the number</li>
<li>I start from the beginning, a comparison of <b>0.(4715)</b> and <b>0.471548</b> goes like this:</li>
<ul>
<li><b>0.(4715) = </b><b>0.4(7154) </b>has the same first digit as<b> </b><b>0.471548, </b>cut it off from both</li>
<li><b>0.(7154) = </b><b>0.7(1547) </b><b><b> </b><span style="font-weight: normal;">has the same first digit as</span> </b><b>0.71548, </b>cut it off</li>
<li><b>0.(1547) = </b><b>0.1(5471) </b><b><b> </b><span style="font-weight: normal;">has the same first digit as</span> </b><b>0.1548, </b>cut it off</li>
<li><b>0.(5471) = </b><b>0.5(4715) </b><b><b> </b><span style="font-weight: normal;">has the same first digit as</span> </b><b>0.548, </b>cut it off</li>
<li><b><b>0.(4715) = </b><b>0.4(7154)</b> </b><b><b> </b><span style="font-weight: normal;">has the same first digit as</span> </b><b>0.48, </b>cut it off</li>
<li><b><b>0.(7154) = </b><b>0.7(7154)</b> </b><b> </b>has the same first digit lower in to<b> </b><b>0.8, so </b><span style="background-color: yellow;"><b>0.(4715) </b><<b> </b><b>0.471548</b></span></li>
</ul>
<li>The situation might be simply more complicated inside the repetition, say <b>0.47(4747)8</b> and <b>0.(474747)8</b>, then it goes like this:</li>
<ul>
<li><b>0.(474747)8 = </b><b>0.4(<b>747474</b>)8 </b>has the same first digit as<b> </b><b><b>0.47(4747)8</b>, </b>cut it off from both</li>
<li><b><b>0.(747474)8 </b>= </b><b>0.7(474747)8 </b><b><b> </b><span style="font-weight: normal;">has the same first digit as</span> </b><b>0.<b><b>7(4747)8</b></b>, </b>cut it off</li>
<li><b style="font-weight: bold;">0.(474747)</b><b> </b>and<b> 0.</b><b style="font-weight: bold;">(4747) </b>are both one line numbers (same order of infinity), compare them</li>
<ul>
<li>the first digits equal, cut it off</li>
<li>the second digits equal, cut it off</li>
<li><b>hey, </b>I was in this comparison before, so <b>0.(474747)</b><b> </b>=<b> 0.</b><b>(4747)</b></li>
</ul>
<li><b>0.8 = 0.8, hence </b><span style="background-color: yellow;"><b>0.47(4747)8</b> = <b>0.(474747)8</b></span></li>
</ul>
</ol>
Most likely, it is not good for anything practical but it brought me back to the good old high school years (and first years at the university), i.e. my algebraic era. And now, back to statistics...<br />
<br />Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0tag:blogger.com,1999:blog-6208519949676270052.post-43330632898206522392013-04-24T02:40:00.000+02:002014-10-06T22:16:50.580+02:00Facebook brainstormingTHIS POST IS OBSOLETE, SEE <a href="http://cran.r-project.org/web/packages/Rfacebook/index.html">RFACEBOOK</a> PACKAGE, MANY THANKS TO ITS DEVELOPERS<br />
<br />
This blog has been sleeping for a long time. I moved from Prague (Czech Rep.) to Bar Harbor (Maine, US) and spent the last month doing paper work and settling down.<br />
<br />
I am glad to note that <a href="http://applyr.blogspot.com/2012/01/mining-facebook-data-most-liked-status.html" target="_blank">Mining Facebook Data: Most "Liked" Status and Friendship Network</a> was the <a href="http://www.r-bloggers.com/100-most-read-r-posts-for-2012-stats-from-r-bloggers-big-data-visualization-data-manipulation-and-other-languages/" target="_blank">56th most read post</a> on R-bloggers last year and its coverage on Revolution Analytics' blog <a href="http://blog.revolutionanalytics.com/2012/01/visualize-your-facebook-friends-network-with-r.html" target="_blank">Visualize your Facebook friends network with R</a> made it to <a href="http://www.r-bloggers.com/four-years-of-the-revolutions-blog/" target="_blank">Top 10</a> most popular 2012 posts. Hope, one day <a href="http://scholar.google.com/citations?user=248ewekAAAAJ&hl=en" target="_blank">my research papers</a> will receive the same level of publicity.<br />
<br />
Meanwhile, I think about other low-hanging fruits:<br />
<ul>
<li>Quantify who "likes" your posts most, use it as a distance in the Friendship Network</li>
<li>Based on TED Talks that you liked in past, predict whether you will like next one (instead of TED Talks, one can look for movies or anything similar)</li>
<li>Automatic birthday wish posting</li>
</ul>
<div>
Any other idea? I will implement one or two of those and post here the codes.<br />
<br />
<br /></div>
Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0tag:blogger.com,1999:blog-6208519949676270052.post-56679684821751933372012-08-08T20:26:00.000+02:002017-01-27T19:12:17.358+01:00Get a path to your Dropbox folderI am currently designing my RStudio - Dropbox - Mardown/Knitter/Wordpress - Github workflow. One problem is that working on multiple machines with different version of Windows means I somehow need to tell R where my Dropbox folder is located.<br />
<br />
I used to set the working directory at the beginning of my R scripts but it became tedious to change the path all the time. The solution might be to add definition of 'dropbox.folder.path' variable to .Rprofile files. Or there is a hard way - to write a script detecting Dropbox location automatically.<br />
<a name='more'></a><br />
<br />
I have found <a href="http://forums.dropbox.com/topic.php?id=9018" target="_blank">this hint</a> and created the script below. It is for Windows only (because I do not have Dropbox on the cluster). However, it should be easy to modify it for linux / MacOS if needed (see this <a href="http://dl.dropbox.com/u/340607/get_dropbox_folder.sh" target="_blank">shell script</a>).<br />
<br />
<br />
<script src="https://gist.github.com/3295533.js"> </script>Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com9tag:blogger.com,1999:blog-6208519949676270052.post-54524499030271764832012-05-29T14:23:00.000+02:002012-05-30T11:15:21.467+02:00Mystery of mysteriesAnd now for something completely different to <a href="http://applyr.blogspot.com/2012/01/mining-facebook-data-most-liked-status.html" target="_blank">Facebook mining</a>. Our paper "<a href="http://onlinelibrary.wiley.com/doi/10.1111/j.1558-5646.2012.01684.x/abstract" target="_blank">DISSECTING THE GENETIC ARCHITECTURE OF F1 HYBRID STERILITY IN HOUSE MICE</a>" has just appeared at Evolution Journal. Let me give a brief explanation - and keep in mind that my major is math, not genetics.<br />
<br />
From statistical point of view it is just an application of <a href="http://kbroman.wordpress.com/" target="_blank">Karl Broman</a>'s R/<a href="http://www.rqtl.org/" target="_blank">qtl package</a>. From biological point of view it is "mystery of mysteries", the term <a href="http://www.expatsingapore.com/forum/index.php?topic=68772.0" target="_blank">used by Darwin</a> to refer to the mechanism by which two groups of animals become genetically incompatible.<br />
<br />
A house mouse is a nice model of that phenomenon because <a href="http://www.informatics.jax.org/silver/figures/figure2-3.shtml" target="_blank">its subspecies</a> diverged relatively recently and you can still force them to breed if you want to. However, as described in the paper, male offspring of certain combination of parents are then unable to reproduce. Our long-term goal is to describe what is behind this sterility.<br />
<br />
Two "ingredients" are already known: Prdm9 gene on Chr17 and "something" hidden in 4.5Mb region on ChrX. If any these two are not present in the required combination of alleles, then the mouse is fertile (or at least has normal testes weight and sperm count). However, as we know, Chr17 and ChrX are not the full story. There is some "secret ingredient(s)" needed to reach the full sterility and we have been unsuccessful in mapping it. Maybe there are just too many genes involved, i.e. our tests are underpowered.<br />
<br />
The second possible explanation (submitted to <a href="http://www.pasteur.fr/ip/easysite/pasteur/en/research/scientific-departments/developmental-biology/units-and-groups/mouse-functional-genetics/ctc2012" target="_blank">CTC Meeting</a> in Paris) is that the "secret ingredient(s)" might not to be a gene or anything you can assign to specific genomic location. Prdm9 (Chr17) is famous for playing role in a genetic recombination, shuffling of genetic information during sperm/eggs production. And recently, we verified that 4.5Mb ChrX region is also taking part in this process. Specifically, Prdm9 determines the location of recombination events and ChrX region influences the recombination frequency. So, is the "secret ingredient" mobile elements, repetitive sequences, heterochromatin or Bigfoot? One day we hope to know.<br />
<br />
<b>Selected papers</b>:<br />
<br />
<ul>
<li>Prdm9 as the speciation (=sterility) gene - <a href="http://www.sciencemag.org/content/323/5912/373.abstract" target="_blank">Mihola et al.: A Mouse Speciation Gene Encodes a Meiotic Histone H3 Methyltransferase</a>, Science (2008).</li>
<li>Prdm9 and its role in recombination - <a href="http://www.sciencemag.org/content/327/5967/836" target="_blank">Baudat et al.: PRDM9 Is a Major Determinant of Meiotic Recombination Hotspots in Humans and Mice</a>, Science (2010).</li>
<li>Sterility QTL on ChrX - <a href="http://www.springerlink.com/content/vjdw8wd518fw5xda/" target="_blank">Storchova et al.: Genetic analysis of X-linked hybrid sterility in the house mouse</a>, Mammalian Genome (2004).</li>
<li>Major recombination QTL on ChrX - <a href="http://www.plosgenetics.org/article/info%3Adoi%2F10.1371%2Fjournal.pgen.1002116" target="_blank">Dumont and Payseur: Genetic Analysis of Genome-Scale Recombination Rate Evolution in House Mice</a>, PLOS Genetics (2012).</li>
</ul>Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0tag:blogger.com,1999:blog-6208519949676270052.post-12250901684324203772012-01-18T21:08:00.000+01:002015-03-19T00:49:39.701+01:00Mining Facebook Data: Most "Liked" Status and Friendship Network<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- pokus -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6910373391426531"
data-ad-slot="2364913401"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="separator" style="clear: both; text-align: left;">
<b>UPDATE 05/2014: The text is now obsolete. Use <a href="http://cran.r-project.org/web/packages/Rfacebook/index.html" target="_blank">Rfacebook package</a> instead, see examples <a href="http://decisionstats.com/2014/05/10/analyzing-facebook-networks-using-rstats/?utm_content=bufferb9956&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer" target="_blank">here</a> and <a href="http://thinktostart.wordpress.com/2013/11/19/analyzing-facebook-with-r/" target="_blank">there</a>.</b></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://romainfrancois.blog.free.fr/" target="_blank">Professional R Enthusiast</a> published a <a href="http://romainfrancois.blog.free.fr/index.php?post/2012/01/15/Crawling-facebook-with-R" target="_blank">quick manual</a> how to use Facebook Graph API. I particularly like a trick to obtain an access-token using <a href="https://developers.facebook.com/tools/explorer" target="_blank">Graph API Explorer</a>.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now, you can easily employ R to get your most "Liked" Facebook status ever. For me it was <a href="http://www.facebook.com/photo.php?fbid=2114395028184&set=a.1062859740459.2010458.1494946240&type=3&theater" target="_blank">this photo</a> followed by a lot of posts about my kids. The same code can be applied to Facebook Group or Page. For example the most popular videos, that appeared on <a href="http://www.facebook.com/TED" target="_blank">TED Page</a> last year, were the following:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li><a href="http://blog.ted.com/2011/10/05/remembering-steve-jobs/" target="_blank">Remembering Steve Jobs</a></li>
<li><a href="http://www.ted.com/talks/graham_hill_less_stuff_more_happiness.html" target="_blank">Graham Hill: Less stuff, more happiness</a></li>
<li><a href="http://www.ted.com/talks/lang/en/simon_sinek_how_great_leaders_inspire_action.html" target="_blank">Simon Sinek: How great leaders inspire action</a></li>
</ul>
See <span id="goog_1769169394"></span><a href="https://gist.github.com/1634662#" target="_blank">the code</a>, it is not so long.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now let us try something more sophisticated. Before Xmas a lot of my friends tested <a href="http://www.facebook.com/MyFnetwork?ref=ts" target="_blank">MyFnetwork</a> app to visualize their friendship networks (see my network below). Surely, this is not the first app doing this. However, this might be the first one really useful. I can see groups of my friends separated (colleagues vs. friends of my wife vs. high school classmates vs. university classmates). Highlighting tries to emphasize the key persons in each group but unfortunately it misses an adjustment for total number of friends (Facebook enthusiasts like PetrC or LenkaZ seem to be more special than they really are). </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFF1bZd1YRGJ2w8rYpqGylqKDWeP5LMgjfXxczuM-Xu6INtm87_HfRdnmlpUL3ywb5V5jgUtxx1_cW92_1n32yqLzK7-AsJFNXACGryS3ykAxdF0WV9TY2C3rxf5mbpb6Juf2XQ6nJUi8/s1600/393865_2328311095952_1494946240_31868041_1712885523_n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFF1bZd1YRGJ2w8rYpqGylqKDWeP5LMgjfXxczuM-Xu6INtm87_HfRdnmlpUL3ywb5V5jgUtxx1_cW92_1n32yqLzK7-AsJFNXACGryS3ykAxdF0WV9TY2C3rxf5mbpb6Juf2XQ6nJUi8/s640/393865_2328311095952_1494946240_31868041_1712885523_n.jpg" height="640" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Original myFnetwork graph</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So how difficult would it be to produce a similar graph with R? Actually, as you can see it is just a few lines of code. First I scraped the list of friends, then for each of them I got the list of mutual friends and finally Rgraphviz package does the plotting stuff. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAsSO88-YvlONsLqBu2qlXEzKzsvCWRcE5Z0O8Lhyphenhyphen17jCvbn8fg3nj6Tyi6x9wvXK38ubbeEFXJBj7VkFc3ms1Mm2xNiTj8G96bqJl_bMjPSgBQ4141l0WSyXy7LKlL5vK7vf_pMPsFUE/s1600/facebook1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAsSO88-YvlONsLqBu2qlXEzKzsvCWRcE5Z0O8Lhyphenhyphen17jCvbn8fg3nj6Tyi6x9wvXK38ubbeEFXJBj7VkFc3ms1Mm2xNiTj8G96bqJl_bMjPSgBQ4141l0WSyXy7LKlL5vK7vf_pMPsFUE/s640/facebook1.png" height="640" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">R/Graphviz plot with initials</td></tr>
</tbody></table>
<script src="https://gist.github.com/1632552.js">
</script>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
As you can see the graphs are pretty similar (most likely, MyFnetwork also uses some port of Graphviz code). Of course, there exists endless list of modifications. For example, you can first download friends' profile pictures and then use custom node plotting function to produce something like the following:</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXwIlMn1Ra9tHBy7ZNrmJxrCWFgT5JgUtcMOwQjx0ihixge3-dO73xhK9jAPdLCvamfjTlyAG3qYUbhrG6ZpJzQvmC160GTeZy_XI9yU6-AcimTD-ZigaXWZ_OBGKMIeSuN3mHC_Q_DPI/s1600/facebook2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXwIlMn1Ra9tHBy7ZNrmJxrCWFgT5JgUtcMOwQjx0ihixge3-dO73xhK9jAPdLCvamfjTlyAG3qYUbhrG6ZpJzQvmC160GTeZy_XI9yU6-AcimTD-ZigaXWZ_OBGKMIeSuN3mHC_Q_DPI/s640/facebook2.jpg" height="640" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">R/Graphviz plot with profile pictures</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<script src="https://gist.github.com/1632567.js">
</script>
Now you can guess who is my wife and who is the problematic friend from <a href="http://applyr.blogspot.com/2012/01/toying-with-google-apps-script.html" target="_blank">the previous post</a> :-) Anyway, <a href="http://www.blogger.com/goog_1906423232">m</a><span style="text-align: left;"><a href="http://www.kakadu-works.com/" target="_blank">yFnetwork</a> claims to get over 1.3 million users in 6 weeks. How difficult could it be make R Facebook/app?</span><br />
<br />
<br />
<a href="http://romainfrancois.blog.free.fr/index.php?post/2012/01/15/Crawling-facebook-with-R" target="_blank">Romain Francois: Crawling facebook with R</a><br />
<br />
<b>Update:</b> I am getting comments about your installation problems with <a href="http://www.omegahat.org/RCurl" target="_blank">RCurl</a> and <a href="http://www.bioconductor.org/packages/release/bioc/html/Rgraphviz.html" target="_blank">Rgraphviz</a> packages. Honestly, I am not administrator of my Ubuntu Linux Server and I have only a limited knowledge about possible issues. RCurl seems to be ok even on my Win32 machine - read the <a href="http://www.omegahat.org/RCurl/FAQ.html" target="_blank">FAQ</a>. Rgraphviz is a bit more tricky: see <a href="https://wiki.duke.edu/display/DUKER/Install+RGraphviz+under+Windows" target="_blank">How to install it under Windows</a> but I would recommend you a decent linux distribution for this work.<br />
<br />Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com43tag:blogger.com,1999:blog-6208519949676270052.post-53041759699892057582012-01-11T11:18:00.000+01:002017-01-27T19:10:42.311+01:00Toying with Google Apps ScriptGoogle offers an access to its services with <a href="http://code.google.com/googleapps/appsscript/guide.html" target="_blank">Apps Scripts</a> (JavaScript). That gives you a possibility to connect your spreadsheet to a fascinating variety of tools like <a href="http://code.google.com/googleapps/appsscript/class_geocoder.html" target="_blank">geocoder</a>, <a href="http://code.google.com/googleapps/appsscript/service_finance.html" target="_blank">stock info</a>, <a href="http://code.google.com/googleapps/appsscript/service_language.html" target="_blank">language translator</a>, or <a href="http://code.google.com/googleapps/appsscript/service_gmail.html" target="_blank">email</a>.<br />
<br />
My java-scripting abilities are rather limited but just playing with tutorial examples I was quickly able to produce a script analyzing time distribution of received emails. It looks through your Gmail for the given contact and record the times of emails sent by it. <br />
<br />
So this is email behaviour of my wife. You can see a peak at the noon when babies are having a nap and another local maximum at the end of the day when they are finally sleeping in beds.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcr-dtHAcsXsRQgAqSmpuLbSLbtgqp4i3OalRLfWrDWVzCLdpz3m-SRXVKxKzuj1vx5mADVdrGXB1S_cR5ucI3kwtCZ_SmbGi_MDu-xlQH966RUUlJhxr9wBZpoM_rI4tvBGN8rjXsPus/s1600/W.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcr-dtHAcsXsRQgAqSmpuLbSLbtgqp4i3OalRLfWrDWVzCLdpz3m-SRXVKxKzuj1vx5mADVdrGXB1S_cR5ucI3kwtCZ_SmbGi_MDu-xlQH966RUUlJhxr9wBZpoM_rI4tvBGN8rjXsPus/s400/W.png" width="400" /></a></div>
<a name='more'></a><br />
<br />
The second example is my friend, <a href="http://applyr.blogspot.com/2011/10/email-netiquette.html" target="_blank">very, very bad email responder</a> (chance for a reply is ~50%). As you can read from the graph most essential emails are answered when the day start, then a few after a lunch... and finally evening responses (usually short and strict). <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh15mTWZP-VUv2zsRWESEvJZ68DqP2r3SJYR1KqnMRkiTND2TuH__tdVwtNUgoYq3TiQvqo9v9x_i0-Twzl-NB6xTK2k4IHJ2R8XDr4MT39EcdJ_tVfSx19Nhm9UPu3qNC1abU312JsRj8/s1600/F.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh15mTWZP-VUv2zsRWESEvJZ68DqP2r3SJYR1KqnMRkiTND2TuH__tdVwtNUgoYq3TiQvqo9v9x_i0-Twzl-NB6xTK2k4IHJ2R8XDr4MT39EcdJ_tVfSx19Nhm9UPu3qNC1abU312JsRj8/s400/F.png" width="400" /></a></div>
<br />
<br />
To try the script yourselves, open a new spreadsheet in GoogleDocs, select Tools -> Script Editor and copy the code below.<br />
<br />
<script src="https://gist.github.com/1587954.js">
</script>
Run it, return to the spreadsheet and enter an email address of the contact of interest. The process takes a minute of two, be patient. You may want to add a command <span style="font-family: "courier new" , "courier" , monospace;">MailApp.sendEmail("your.name@yourmail.com", "</span><span style="font-family: "courier new" , "courier" , monospace;">Finished</span><span style="font-family: "courier new" , "courier" , monospace;">", "Google Apps Script");</span> before the last "<span style="font-family: "courier new" , "courier" , monospace;">}</span>" to be warned by mail when the job is finished.<br />
<br />
After this, the first column is filled with time stamps information and we need a way to visualize it. Google App Script have a charting module but I found more convenient to use R/ggplot2 plotting services. A few lines of code are given below (before that the Google spreadsheet was published to web and the link was copied into, alternatively you could use RGoogleDocs).<br />
<br />
<script src="https://gist.github.com/1587973.js">
</script>
Gmail blog: <a href="http://gmailblog.blogspot.com/2011/07/gmail-snooze-with-apps-script.html" rel="bookmark">Gmail Snooze with Apps Script</a>Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com2tag:blogger.com,1999:blog-6208519949676270052.post-42743332840657746912011-12-07T16:02:00.001+01:002017-01-27T19:09:49.456+01:00UseR! 2011 slides are now availableI have just realized that UseR! 2011 presentation slides are now available from <a href="http://www.warwick.ac.uk/statsdept/user-2011/schedule/index.html">the conference web site</a>.<br />
<br />
Unfortunately, no big surprise this year. Or maybe this is good news as it means that I have all the important stuff in my RSS Reader. And by the way, this blog is now listed on <a href="http://www.r-bloggers.com/">www.r-bloggers.com</a>.<br />
<br />
To be fair there was a couple of interesting talks (reaching my attention before the slides were published), namely<br />
<br />
<a href="http://www.stat.auckland.ac.nz/~paul/Talks/UseR2011/processing.pdf" target="_blank">Paul Marrel: Vector Image Processing</a><br />
Paul is converting static PDF image into dynamic SVG graphics. This is not so much about R but it is really cool.<br />
<br />
<a href="http://code.google.com/p/google-motion-charts-with-r/" target="_blank"><span class="Apple-style-span" style="background-color: white; font-family: "helvetica" , "arial" , "dejavu sans condensed" , "tahoma" , "nimbus sans l" , "liberation sans" , sans-serif; font-size: 13px;">Markus Gesmann: </span>Using the Google Visualisation API with R</a><br />
Easy way how to put dynamic images on your web page. Particularly useful, if you work with GPS tracking data. Verified :-)<br />
<br />
<a href="http://www.slideshare.net/RevolutionAnalytics/its-a-boy-an-analysis-of-96-million-birth-records-using-r" target="_blank"><span class="Apple-style-span" style="background-color: white; font-family: "helvetica" , "arial" , "dejavu sans condensed" , "tahoma" , "nimbus sans l" , "liberation sans" , sans-serif; font-size: 13px;">Susan Ranney: </span>It's a Boy! An Analysis of Tens of Millions of Birth Records Using R</a><br />
RevoScaleR functionality demonstrated on 3.1GB dataset of birth records.<br />
<br />
<a href="http://www.warwick.ac.uk/statsdept/user-2011/TalkSlides/Invited/Gromping-Design_of_Experiments.pdf" target="_blank">Ulrike Grömping: Design of Experiments in R</a><br />
This is a bit personal. I have very little (read "no") experience with designing experiments (DoE). Back in 2008 I met my wife's supervisor that was an author of an old commercial DoE software. We both realized that R missed a lot of DoE methods. The problem was my lack of theoretical knowledge in this area and his style of work. I gave up but I am happy that they finally finished the job without me - the book was published and the package is available on CRAN. Looking into <a href="http://cran.r-project.org/web/views/ExperimentalDesign.html" target="_blank">DoE CRAN Task View</a> - we were not alone.Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0tag:blogger.com,1999:blog-6208519949676270052.post-19216144930887525772011-11-23T16:22:00.001+01:002017-01-27T19:09:11.175+01:00Prague Half Marathon Ranking: 2% or 25% missing?<br />
<div class="MsoNormal">
<span lang="EN-US">I am a regular participant of <a href="http://www.praguemarathon.com/en" target="_blank">Prague International Half Marathon</a>. In a mass event like this the horde of runners needs a long time to reach the starting line. To make the times mutually comparable the “start time” is measured and afterwards subtracted from the “finish time”. Also the crowd is organized to corridors in such a way that faster runners are ahead of the slower ones.</span><br />
<br />
Sometimes everything goes wrong and that was the case of the year 2010. Imagine yourself to train for months then make your best – just to discover that your time of start was not recorded. Organizers apologized but claimed that only <a href="http://www.praguemarathon.com/en/component/content/news/59-news/757-answers-to-questions-related-to-the-ranking-of-the-12th-hervis-prague-half-marathon" target="_blank">less than <b>2%</b> of the participants were affected</a>. Really?<br />
<a name='more'></a><br />
<br />
<span lang="EN-US">Let us use R to scrape and compare histograms of 2009, 2010 and 2011 start times to see the truth <o:p></o:p></span>(red dashed line at 20 is approximate capacity of starting line):</div>
<div class="MsoNormal">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq2qNY2OgZanv96vBlW0NyDELoZg3OgPbufYSZiyXC8k1isba68zBbP_YoxFLRntNRwoysPcCj5srkzonQV9NgKY6qiiq-t9217eInkVJVnS0-2mkYyW-gJIUaaEiaxGd8AU3rM2CYKyM/s1600/Rplot01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="215" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq2qNY2OgZanv96vBlW0NyDELoZg3OgPbufYSZiyXC8k1isba68zBbP_YoxFLRntNRwoysPcCj5srkzonQV9NgKY6qiiq-t9217eInkVJVnS0-2mkYyW-gJIUaaEiaxGd8AU3rM2CYKyM/s400/Rplot01.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuWuQExQ1-nYJpX3ofEOU2V2AirQ4Ls6ZJ7Ts9m6STNT-B56QL-2MRF5LoRz6qvXAkrsBXgzDxlDUQC1Bjhzk5cEDZXXcoCU77LCfQQPledY9V9799ZSDJULDByOivqJXDfBsu_IY8CPk/s1600/Rplot02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="215" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuWuQExQ1-nYJpX3ofEOU2V2AirQ4Ls6ZJ7Ts9m6STNT-B56QL-2MRF5LoRz6qvXAkrsBXgzDxlDUQC1Bjhzk5cEDZXXcoCU77LCfQQPledY9V9799ZSDJULDByOivqJXDfBsu_IY8CPk/s400/Rplot02.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA0Edjj1cJ7SUtlnVQQUiUr4GM4jtXdH8LmJGlArntqxAfeAEupFq5w0EIKRTLwXNyH4MyGH-gYqPp8-yrpV2Werk3XKELcTfvr9wjLIfTxD_wNKoJNjLyzQv_LHeRPWzaYOR-Bv2rYX8/s1600/Rplot03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="215" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA0Edjj1cJ7SUtlnVQQUiUr4GM4jtXdH8LmJGlArntqxAfeAEupFq5w0EIKRTLwXNyH4MyGH-gYqPp8-yrpV2Werk3XKELcTfvr9wjLIfTxD_wNKoJNjLyzQv_LHeRPWzaYOR-Bv2rYX8/s400/Rplot03.png" width="400" /></a></div>
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"><br /></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US">See? The peaks in 2010 data are actually a nice try of organizers to do some statistics and correct for missing measurements. Based on starting number mirrorring both the expected time and the position in corridors they tried to make estimates for each corridor starting time. The averages were imputed into <b>~25%</b> of observations that were actually missing.<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-US">Why is this so wrong? Because the ordering of runners was not under control. In 2009 and 2010 runners went wherever they wanted as you can see seen on the following graphs. Actually, in 2010 the slow runners just behind the Kenyans caused the jam. </span><br />
<span lang="EN-US"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrG4qwDN6cIt49aYnPpAhDeRwkLQyO678csnrq78-TWu842s22glJonwtUyh2X0jZZmRB2J8xceVKYaYKXgH7zTO2eiUd1vBP8FNeeFRIGyaoSjZP2ygsVtk4m7_OPveDE_nUUX6Ld5dc/s1600/Rplot04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="215" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrG4qwDN6cIt49aYnPpAhDeRwkLQyO678csnrq78-TWu842s22glJonwtUyh2X0jZZmRB2J8xceVKYaYKXgH7zTO2eiUd1vBP8FNeeFRIGyaoSjZP2ygsVtk4m7_OPveDE_nUUX6Ld5dc/s400/Rplot04.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSCOQ0OQEIFhVTVoRX7XuP8rIVg5Ca994eKoABi2XABc8i-QOd81G7XHlMM-0TV3q2ZFXt-G_JJYmXvKSQEDSI2gxIxfg_HFvy0ghm84RLOPGodnxp3-w-J9oQN3XGkEGlCstSM1drdVU/s1600/Rplot05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="215" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSCOQ0OQEIFhVTVoRX7XuP8rIVg5Ca994eKoABi2XABc8i-QOd81G7XHlMM-0TV3q2ZFXt-G_JJYmXvKSQEDSI2gxIxfg_HFvy0ghm84RLOPGodnxp3-w-J9oQN3XGkEGlCstSM1drdVU/s400/Rplot05.png" width="400" /></a></div>
<span lang="EN-US"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-US">Good news at the end? Yes! Even organizers were denying the truth they learned a lesson from their mistakes. In 2011 an extra care was devoted to time measuring and as you can see ordering to corridors got much better. </span><br />
<span lang="EN-US"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjh3DxowwZRRNhW8XHiC3LjcJKKTk20vmidziOgUnaEq1NtKNLc-CT3fRRZcxKdnZ9uaUoVd6gfPdP4Wv8UtaT-qH4M7biTP0oQh4oFQ1ydqHLgyTwCLfqH9cNGSimNJPrD5Yg59_asQzk/s1600/Rplot06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="215" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjh3DxowwZRRNhW8XHiC3LjcJKKTk20vmidziOgUnaEq1NtKNLc-CT3fRRZcxKdnZ9uaUoVd6gfPdP4Wv8UtaT-qH4M7biTP0oQh4oFQ1ydqHLgyTwCLfqH9cNGSimNJPrD5Yg59_asQzk/s400/Rplot06.png" width="400" /></a></div>
<br />
<br />
Finally, the code of all above:<br />
<br />
<script src="https://gist.github.com/1389293.js">
</script>Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0tag:blogger.com,1999:blog-6208519949676270052.post-73142524448991335672011-10-26T18:19:00.000+02:002011-11-18T17:05:07.170+01:00How to display R code on a web pageStarting to write a blog I need a way how to publish my R codes. One possibility would be to just add some formatting with <a href="http://blog.revolutionanalytics.com/2010/11/dress-your-r-code-for-the-web-with-pretty-r.html">Pretty R</a>. Nice, but I miss a repository with all codes ever submitted and possibility to make corrections.<br />
<br />
The final solution was to create an account on <a href="https://github.com/">Github</a> and submitting codes via <a href="http://gist.github.com/">Gist</a>. The only problem was you cannot see the code in the Google Reader. I believe I can live with it. <br />
<br />
Getting Genetics Done: <a href="http://gettinggeneticsdone.blogspot.com/2010/11/syntax-highlighting-rstats-code.html">Syntax Highlighting R Code, Revisited</a>Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0tag:blogger.com,1999:blog-6208519949676270052.post-40769597925174463942011-10-25T17:26:00.000+02:002017-01-27T19:08:48.673+01:00Email NetiquetteA short piece of web-scrapping I sent as a reminder to my colleague.<br />
<a name='more'></a><br />
<br />
<script src="https://gist.github.com/1313264.js"> </script>
If you run it the result should be something like...
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz6jaCWuvWrcZ5V1d8EJIs-HtgzM32z9yEByGOIN6MoD7Oqz0HAbtU4sNnr2rQPc6qNvEIcVqLxYtrZeFEdIosSrIvdywoUNBcI8D3ta_VREsEsCJbaycrenLgDk1doxyiTSu-XUvj9dU/s1600/netiquette.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz6jaCWuvWrcZ5V1d8EJIs-HtgzM32z9yEByGOIN6MoD7Oqz0HAbtU4sNnr2rQPc6qNvEIcVqLxYtrZeFEdIosSrIvdywoUNBcI8D3ta_VREsEsCJbaycrenLgDk1doxyiTSu-XUvj9dU/s320/netiquette.png" width="320" /></a></div>
<br />
Datatata!Půlnoční běžechttp://www.blogger.com/profile/15968750617146554594noreply@blogger.com0