Hi colleages! I want to import data from ms-excel and other spreadsheet formats (lotus, etc). Does exist any way to do it within R? The main problem is that many spreadsheet data use comma as decimal separator and not the point as needed in R (and many software for Linux), so importing data first as a tab separated values does not solve this problem. Thanks, Tom?s Revilla -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Tom?s Revilla <trevilla at strix.ciens.ucv.ve> writes:> Hi colleages! > > I want to import data from ms-excel and other spreadsheet formats (lotus, etc). Does exist any way to do it within > R? The main problem is that many spreadsheet data use comma as decimal separator and not the point as needed in R > (and many software for Linux), so importing data first as a tab separated values does not solve this problem.Oh yes it does. Notice the "dec" argument and read.delim2(). -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 26 Apr 2002, [windows-1252] Tomás Revilla wrote:> Hi colleages! > > I want to import data from ms-excel and other spreadsheet formats(lotus, etc). Does exist any way to do it within> R?There exist several ways, and R has a manual `R Data Import/Export' to explain them to you. Since you haven't even told us what OS you are using, it is hard to be more specific. On Windows (and you mailed in a Windows character set), RODBC can read directly from the spreadsheet.> The main problem is that many spreadsheet data use comma as decimalseparator and not the point as needed in R> (and many software for Linux), so importing data first as a tab separatedvalues does not solve this problem. That's not correct. Look at the manual, and functions read.delim2 and read.csv2. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Tom?s Revilla wrote:> > Hi colleages! > > I want to import data from ms-excel and other spreadsheet formats (lotus, etc). Does exist any way to do it within > R? The main problem is that many spreadsheet data use comma as decimal separator and not the point as needed in R > (and many software for Linux), so importing data first as a tab separated values does not solve this problem.What about read.table(..., dec=",") as mentioned in ?read.table ? Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On 04/26/02 07:45, Tom?s Revilla wrote:>Hi colleages! > >I want to import data from ms-excel and other spreadsheet formats (lotus, etc). Does exist any way to do it within >R? The main problem is that many spreadsheet data use comma as decimal separator and not the point as needed in R >(and many software for Linux), so importing data first as a tab separated values does not solve this problem.See the help for read.table(). There are several different versions of that for different kinds of delimiters and an option "dec" to specify the kind of decimal point. In general, the help files are very useful. -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page: http://www.sas.upenn.edu/~baron -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Check out the dec= parameter of the scan command. On 26 Apr 2002 at 7:45, Tom?s Revilla wrote:> I want to import data from ms-excel and other spreadsheet formats (lotus, etc). Does exist any way to do it within > R? The main problem is that many spreadsheet data use comma as decimal separator and not the point as needed in R > (and many software for Linux), so importing data first as a tab separated values does not solve this problem.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Tom?s Revilla wrote:> Hi colleages! > > I want to import data from ms-excel and other spreadsheet formats (lotus, etc). Does exist any way to do it within > R? The main problem is that many spreadsheet data use comma as decimal separator and not the point as needed in R > (and many software for Linux), so importing data first as a tab separated values does not solve this problem. > > Thanks, > > Tom?s Revilla >Hi, you can substitute the comma with a point in almost any editor (I think Notepad cannot...) or use sed/Perl/awk etc or R (R can read the data as character vectors and then use gsub to find the commas and replace them, transform the data to a matrix or data frame). Hope this helps, Sven -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Helo Tomas, I just saw the R list email, sory for the lkat reply, but I think nobody focused on this point, which might be important for "latin" users: I think your problem as to do with the configuration of your computer. The decimal separator "oficially" changes from contry to contry, so for example in Spain it is a comma, although in UK it is a dot, as in R. So, you will have this problem with most statistical packages,... In windows it is very simple to solve it permenently: you go to start> Control pannel> "configuracion regional" and either change the country to UK, or manually change the character for decimal etc... This (as long as I know) does not affect your computer in nothing else, except for the decimal separator! BEst regards Marta Hi colleages! I want to import data from ms-excel and other spreadsheet formats (lotus, etc). Does exist any way to do it within R? The main problem is that many spreadsheet data use comma as decimal separator and not the point as needed in R (and many software for Linux), so importing data first as a tab separated values does not solve this problem. Thanks, Tom?s Revilla><((((?>`?.??.???`?.?.???`?...?><((((?>`?.??.???`?.?.???`?...?><((((?>`?.??.???`?.?.???`?...?><((((?>`?.??.???`?.?.???`?...?><((((?>`?.??.?? Marta Rufino Centre Mediterrani d'Investigacions Marines i Ambientals (CMIMA). CSIC Passeig Maritim 37-49 08003 BARCELONA Tfno:34 93 230 95 40 Tfax:34 93 230 95 55><((((?>`?.??.???`?.?.???`?...?><((((?>`?.??.???`?.?.???`?...?><((((?>`?.??.???`?.?.???`?...?><((((?>`?.??.???`?.?.???`?...?><((((?>`?.??.?? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._