Wednesday, June 25, 2014

How to plot heatmap in R with only one column

If you've tried to plot heatmap in R with only one column you got an answer:
 `x' must have at least 2 rows and 2 columns
Trick to plot heatmap with only one column is to make a matrix with the same column twice and then to do a heatmap. Use the command cbind to bind matrix, column by column
matrix_name <- cbind (matrix_name, matrix_name)
The output will look similar to this one I created.



Saturday, June 21, 2014

How to copy symbolic links in Unix

If you have symbolic links that you want to copy to another folder, using cp command will copy the actual files that the links are linking to. Use cp with -av option.
cp -av <linkname> <folder>