Re: [R] comma as a seperator to numeric

2012-11-28 Thread Mat
gsub() works perfectly, thank you very much. Mat -- View this message in context: http://r.789695.n4.nabble.com/comma-as-a-seperator-to-numeric-tp4651090p4651106.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

Re: [R] comma as a seperator to numeric

2012-11-28 Thread Ivan Calandra
Hi Mat, You could first replace your commas with points using gsub(). Or you could import your data differently (using read.csv2() for example) See ?gsub and ?read.csv HTH, Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel 21000 Dijon, FRANCE +33

[R] comma as a seperator to numeric

2012-11-28 Thread Mat
Hello together, i have a big problem, to convert a column in my data.frame to numeric. I have: 61,13 in the column and write: data$PT_DL<-as.numeric(as.character(data$PT_DL)) the result is NA, not a point seperated number. How can i change the data to an as.numeric number? Thank you for your h