codeRclub | bioCEED R coding club

Archive for May 2015

May/15

21

Progress bars and for loops.

Today somebody asked me about building a progress bar into a for loop. This can be really useful if you are running lots of bootstrapping or Monte Carlo simulations, and you want some peace of mind so that you know that loop is still running as the computer chugs away in the background. It’s good […]

· · ·

In Friday’s codeRclub, we had a problem which involved finding the row and column names for items in a matrix greater than a specified value (e.g. finding the names of the pairs of samples in a  correlation matrix with correlation coefficient greater than 0.5). The problem is that using standard sub-setting methods you are able […]

· · ·

May/15

7

Expressions in R

expression() and related functions including bquote() are powerful tools for annotating figures with mathematical notation in R. This functionality is not obvious from their respective help files. demo(plotmath) nicely shows the huge potential of expression(), but does not help that much with getting the code need for many real cases. I tend to get my […]

· · ·

May/15

7

Formatting R code in WordPress

To show formatted code within a paragraph, for example a function name, use <code>plot</code> which will appear as plot. To show a block of code, use something like this but using square brackets [] rather than braces {}. {code language=”r”} x<-rnorm(100) hist(x) #don't forget comments {/code} Setting the language to R lets the WordPress plugin use appropriate […]

No tags

Theme Design by devolux.nh2.me