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, sep = ";", dec = > ",", nrows = -1) > > In addition, I copy/past into the post the link to the csv file generated by > my instrument. > > https://dl.dropbox.com/u/95607996/Specimen_RawData_1.csv > > The file is encoded in ANSI, I tried also the following string, but the > result was the same > tab <- read.csv2("Specimen_RawData_1.csv", header = TRUE, sep = ";", dec = > ",", nrows = -1, encoding = "ANSI") > > The possibility to open the file into a text editor and replace comma with > point is a crazy way, because I have around 1000 files to elaborate. > The only way for me is to use R. > > I hope that someone can help me to find the issue.
Delete 2nd line and use plain read.csv2. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd....@cbs.dk Priv: pda...@gmail.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.