Blog Archives

best note on reshape2

July 15, 2014
By

I found this elegant note about reshape2 from Sean Anderson's blog:http://seananderson.ca/2013/10/19/reshape.html

Read more »

Access Google Spreadsheet directly in bash and in R

January 31, 2014
By

Google Doc is a good way to share/manage documents between you and your colleagues, but sometime you want to directly access the data in terminal (e.g. bash) or in program (e.g. R), without downloading the data first. For example, I have a Google Spre...

Read more »

How to see source code of a function/method in R?

January 15, 2014
By

If it's an internal function of R (e.g. from base package), just type the function name, like> rowMeansfunction (x, na.rm = FALSE, dims = 1L) {    if (is.data.frame(x))         x <- as.matrix(x)  &nbsp...

Read more »

R / Bioconductor for High-Throughput Sequence Analysis

December 6, 2013
By

I would like to recommend a recent workshop material on R/Bioconductor from Marc Carlson et al.http://www.bioconductor.org/help/course-materials/2013/SeattleMay2013/PDF: IntermediateSequenceAnalysis2013.pdfR script: IntermediateSequenceAnalysis201...

Read more »

Google Developers R Programming Video Lectures

August 8, 2013
By

I got this Google Developers R Programming Video Lectures from Stephen's blog - Getting Genetics Done.Very useful R tutorial for beginner! Short and efficient. Here is what I learned after watching the lectures:4.3 - Add a Warning or Stop the Func...

Read more »

methods of calling differential region of ChIP-seq

August 7, 2013
By

Related papers to read:Model-based Analysis of ChIP-Seq (MACS)MACS can also be applied to differential binding between two conditions by treating one of the samples as the control. Since peaks from either sample are likely to be biologically meaningful...

Read more »

counts numbers in a interval

February 5, 2013
By

Say I have a list of values, and I cut them by some break points, how do I know the number of values in each interval?We know cut() function in R works for the purpose.  For example,tx0 <- c(9, 4, 6, 5, 3, 10, 5, 3, 5)x <- rep(0:8, tx0)> ...

Read more »

line width in R and in Illustrator

December 17, 2012
By
line width in R and in Illustrator

I've drawn figure in R with lwd=1, e.g.pdf('test.pdf')plot(1:10, type='o', lwd=2, axes=F)box(lwd=1, col='red')dev.off()And then you open the PDF in Illustrator, you will see the border width is 0.75pt, and the line is 1.5pt, which seems that the unit of 1 in R is 0.75pt in Illustrator.How is this defined? Where can I change it?I found the answer by...

Read more »

write.table with proper column number in the header

December 5, 2012
By

Did you notice that the file generated from write.table() in R has missed a tab (\t) in the top-left corner, when row.names=T (by default)?I found the solution here:http://stackoverflow.com/questions/2478352/write-table-in-r-screws-up-header-when-has-r...

Read more »

draw figures in CMYK mode in R

October 31, 2012
By
draw figures in CMYK mode in R

Print publication usually ask to use CMYK (instead of RGB) color mode for figures (because not every color can be print out), while we usually use RGB for screen reading (because screen has larger range of color scale). Of course we can convert RGB to ...

Read more »