rmarkdown and terminal colors
The R output in rmarkdown strips all terminal control sequences – colors and formats (i.e., bold or italics). However, it is relatively easy to restore it. For this, one needs...continue reading.
The R output in rmarkdown strips all terminal control sequences – colors and formats (i.e., bold or italics). However, it is relatively easy to restore it. For this, one needs...continue reading.
It all started when I wanted to have significant p-values shown on the terminal colored in red. The R terminal is capable of showing colors, simple formatting (like italics or...continue reading.
If your rmarkdown takes hours to generate, and you want to be able to generate different document output types on the fly, using the output_format option from rmarkdown::render is extremely...continue reading.
Say the package name is stored in variable x and the name of the object you would like to access from that package (without loading the package) is stored in...continue reading.
Quick and dirty Rmarkdown syntax highlighting for vim, when you don’t have time install bundles, plugins or dependencies: go to this github repository, download the file rmd.vim from the syntax/...continue reading.
OK, so this was an easy thing to find out, but enormously useful. In vim, Ctrl-P and Ctrl-N allow to complete a word in insert mode. By default (see the...continue reading.
Often we use lists to map keywords onto values, for example To invert this list (such that “fark”, “bark” etc. become keywords, and “a”, “b” and “c” the values), do...continue reading.
A caret call I frequently use. Given that x is training data and y response, library(doMC) and registerDoMC allow me to use more than one processor repeatedcv: if more than...continue reading.
Many languages allow you to use a custom comparison function in sorting. R is not an exception, but it is not entirely straightforward – it requires you to define a...continue reading.
This one cost me more time to figure out than it should have. The reason being, it turns out that I never properly understood what the source() function does. So...continue reading.
I decided to submit a manuscript using only R with knitr, pandoc and make. Actually, it went quite well. Certainly, revisions of manuscript with complex figures did not require much...continue reading.
If you make the error which I did, you will try to use the data (say, “pckgdata”) from another package (say, “pckg”) naively like this: This will result in an...continue reading.
Here is a little script to show you your life. In weeks. Each point is a week. Each black point is a week that you have already spent. The number...continue reading.
I have a dream: a scientific editor that would be suitable for editing scientific papers. Currently, Word is king. There is no way around it: everybody has it, everybody uses...continue reading.
I see it more and more frequently: bar plots which are supposed to illustrate the regulation of a gene in terms of “fold change”, which include a “0” on the...continue reading.