haotu : an open lab notebook

2014/10/15

Publish and Produce Slides from R markdown

Filed under: Uncategorized — S @ 13:00

http://slidify.org/

Advertisements

color in R

Filed under: Uncategorized — S @ 10:58

Useful color tips and functions

FROM: https://d396qusza40orc.cloudfront.net/exdata/lecture_slides/RColors.pdf

colorRamp: Take a palette of colors and return a function that takes valus between 0 and 1, indicating the extremes of the color palette (e.g. see the ‘gray’ function)

[,1] [,2] [,3] corresponds to [Red] [Green] [Blue]

> pal = colorRamp(c("red", "blue"))  
> pal(0)
[,1] [,2] [,3]
[1,] 255 0 0
> pal(1)
[,1] [,2] [,3]
[1,] 0 0 255
> pal(0.5)
[,1] [,2] [,3]
[1,] 127.5 0 127.5

colorRampPalette: Take a palette of colors and return a function that takes integer arguments and returns a vector of colors interpolating the palette (like heat.colors or topo.colors)

 pal = colorRampPalette(c("red", "yellow"))
> pal(2)
[1] "#FF0000" "#FFFF00"
> pal(10)
[1] "#FF0000" "#FF1C00" "#FF3800" "#FF5500" "#FF7100"
[6] "#FF8D00" "#FFAA00" "#FFC600" "#FFE200" "#FFFF00”

see also RColorBrewer
http://www.compbiome.com/2010/12/r-using-rcolorbrewer-to-colour-your.html
http://cran.r-project.org/web/packages/RColorBrewer/index.html

fill in missing data in R

Filed under: Uncategorized — Tags: , — S @ 10:34

http://www.bioconductor.org/packages/release/bioc/manuals/impute/man/impute.pdf

The impute package developed for microarrays can replace missing (NA) data in an R matrix by its nearest neighbor values.

2014/10/10

Diagnostics for Logistic Regression

Filed under: Uncategorized — S @ 07:49

A student recently asked me how to assess the fit of a logistic regression. After some digoogling I found this post which was quite helpful

http://stats.stackexchange.com/questions/45050/diagnostics-for-logistic-regression

Asking for Help the Right Way

Filed under: Uncategorized — Tags: — S @ 07:45

A general video for how to ask for help on coding listservs, forums etc.

Blog at WordPress.com.