It is very easy to flip transpose a data frame in R.
The antilogit value of a variable can. E useful in plotting.
Notes on basic import and export in R.
Some quick ways to visualise new data.
You will often want to combine different datasets with a column in common. This is easy to do in R.
With clusterSim library
If x is the normalised data and y is the old data, we would like to do y = (x-mean(x))/sd(x)
One way is to use the clusterSim library
Then a variable can be normalised for mean=0, variance=1 using:
As a bonus, there are other types of normalisation (other than type="n1"). For more information look at the help file.
Without any library
x<-sweep(y, 2, apply(y, 2, mean), "-") x<-sweep(x, 2, apply(x, 2, sd), "/") names(x)<-paste("s", names(x), sep="")
Note that if any values are 0 the normalisation will generate infinite values, which may need to be dealt with.
To change the name of a column in a data.frame
It is often necessary to replace values in a column in data.frame, for example NAs with 0s.
Ordering a data frame by a particular column can be quicker than doing it in excel, if the data frame is large.
I setup the sexChr_papers twitter bot following Rob Lanfear's instructions.
I am interested in papers on sex chromosome evolution, and thus remove medical search terms. The pubmed search is sex chromosome NOT aneuploidy NOT patient? NOT chronic NOT acute NOT clinical NOT prenatal NOT diagnostic NOT congenital NOT infant? NOT syndrome NOT trisom* NOT sperm.
Casey Bergman is gathering literature Twitter bots here.