Showing posts with label R. Show all posts
Showing posts with label R. Show all posts

Wednesday, April 29, 2009

R library som

Self-organizing maps for clustering, need large number of iterations.
A filtering function in the package,

filtering()

is very helpful to floor, ceil the input data table.

Saturday, April 4, 2009

ggplot2: Great plot libs

Just put up a post first. More details coming up soon.

Wednesday, April 1, 2009

Robust correlations

The traditional correlation measures are not suitable for noisy or those with outliers. Non-parametric methods like Kendall and Spearman can do slightly better job than Pearson but not enough.

The R package robust provides nice robust correlation methods, covRob:

R LINK

Other robust methods can be found here:
Robust Task View

For outlier removal, you may refer to outliers package. Honestly, it's not doing a good job at all.

Tuesday, March 31, 2009

Heatmaps

There are several functions you may employ to get heatmaps:
default heatmap, image

heatmap.2 in gplots package
heatplot in made4 Bioconductor package
heatmap_2, heatmap_plus in Heatplus Bioconductor package

So far heatmap.2 in gplots works best. If you want to plot some covariates use heatmap_plus

The easiest way to define a custom colorPalette is

colorRamPalette(colors)(num_of_interpretation)

Monday, March 30, 2009

Granger Test of Causality

Test whether one time series can predict another
Here's the R link:

R Link

P.S.
notes: sometimes i hate the nomenclature differences in different programming languages:

in R, converting a form into string is the function as.character(), i was looking for a function like toString, string... blah, never got any luck. This reminds me of a simple function of getting the length of an array:

Java: arrayObject.length
Javascript: arrayObject.length
R: length(arrayObject)
Perl: scalar arrayObject
PHP: sizeof(arrayObject)
...

Tuesday, March 24, 2009

R libraries [Clustering, Classification, LM]

Nice functions to quickly manipulate Rmetrics: fUtilities package


Basic libs:

cluster
class
stat

Model based:
mclust

Linear Models:
MASS
lmtest
car

This post will be updated.

Monday, March 23, 2009

WGCNA Package

A package for weighted correlation network analysis. It would be interesting to look at how this method can do for network analysis.

Resource Link

Paper Link

GeneNet Package

To do data transformations, there's a package named GeneNet; designed to analyze gene expression (time series) with the focus on gene networks.

they have handy transformation functions:

z.transform and hotelling.transform.

Note that these two transformations only work on correlation coefficients, with the range from -1 to 1.

Link

Sunday, March 22, 2009

Bagged Clustering

A given partitioning clustering algorithm is run repeatedly on bootstrapped data, the cluster centers then merged by hierarchical cluster algorithm. This is good for noisy data / small sample size.

From R library e1071, function bclust

R Doc Link

Also here's an online powerpoint that demonstrates the application on simulated metabolomics data:

Bagged K-means Metabolomics PPT