Re: [R] Problem to read non-standard csv file

2012-10-12 Thread Roberto
arun kirshna wrote > Hi, > Try this: > tab1<-read.csv2("Specimen_RawData_1.csv",sep="\t",nrows=-1) > tab2<-as.data.frame(sapply(tab1,function(x) > gsub("[,]",".",x)),stringsAsFactors=FALSE) > tab3<-tab2[-1,] > tab3[]<-sapply(tab3,as.numeric) > row.names(tab3)<-1:nrow(tab3) > head(tab3) > # Caric

Re: [R] Problem to read non-standard csv file

2012-10-12 Thread peter dalgaard
On Oct 12, 2012, at 18:45 , Roberto wrote: > Hi all, > I have a problem to read csv file with comma as decimal. The numbers were > readed as strings. > > I used the following string in R, but I do not understand why it does not > work. > tab <- read.csv2("Specimen_RawData_1.csv", header = TRUE,

[R] Problem to read non-standard csv file

2012-10-12 Thread Roberto
Hi all, I have a problem to read csv file with comma as decimal. The numbers were readed as strings. I used the following string in R, but I do not understand why it does not work. tab <- read.csv2("Specimen_RawData_1.csv", header = TRUE, sep = ";", dec = ",", nrows = -1) In addition, I copy/past