Hi Nico,
Try:
setAs("character", "num.commas",
function(from) as.numeric(gsub(",", "", from) ) )
d1 <-
read.csv("cont.txt",header=TRUE,sep="\t",colClasses=c("numeric","character","num.commas"))
colnames(d1)[-3] <- c("loc","variables")
library(reshape2)
res <- dcast(d1,loc~variables,value.var="value",mean)
row.names(res) <- res[,1]
res1 <- as.matrix(res[,-1])
dim(res1)
#[1] 129 190
A.K.
On Tuesday, October 15, 2013 8:07 AM, Nico Met <nicome...@gmail.com> wrote:
Hi Arun, many thanks. Here I attached the data.
Regards
Nico
______________________________________________
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.