Thank you everyone for your kind input, I forgot to add that I have decimal points in my matrix !
Enclosed input file (reduced to 10 X 10 matrix), scripts and output for your suggesions: Code 1: library(stats) Matrix<-read.table("test_input", head=T, sep=" ", dec=".") SD<-sd(as.numeric(Matrix)) SD Output 1: > library(stats) > Matrix<-read.table("test_input", head=T, sep="\t", dec=".") > SD<-sd(as.numeric(Matrix)) Error in sd(as.numeric(Matrix)) : (list) object cannot be coerced to type 'double' Execution halted Code 2: library(stats) Matrix<-read.table("test_input", head=T, sep="\t", dec=".") dim(Matrix)<-1 SD<-sd(Matrix) SD Output: > library(stats) > Matrix<-read.table("test_input", head=T, sep="\t", dec=".") > dim(Matrix)<-1 Error in dim(Matrix) <- 1 : dims [product 1] do not match the length of object [10] Execution halted Code 3: library(stats) Matrix<-read.table("test_input", head=T, sep="\t", dec=".") SD<-sd(c(Matrix)) SD Output: > library(stats) > Matrix<-read.table("test_input", head=T, sep="\t", dec=".") > SD<-sd(c(Matrix)) Error: is.atomic(x) is not TRUE Execution halted Any ideas, what am I missing here ? TIA chakri Input file: http://r.789695.n4.nabble.com/file/n3712328/test_input test_input -- View this message in context: http://r.789695.n4.nabble.com/Standard-Deviation-of-a-matrix-tp3711991p3712328.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.