What is the best way to read in data of any type from an Excel 2016 .xlsx file? Thanks Bernard Sent from my iPhone so please excuse the spelling!"
https://cran.r-project.org/web/packages/xlsx/xlsx.pdf You'll need the JDK (>= 1.6) -- H On Thu, 10 Jan 2019 at 13:40, Bernard Comcast <mcgarvey.bernard at comcast.net> wrote:> What is the best way to read in data of any type from an Excel 2016 .xlsx > file? > > Thanks > > Bernard > Sent from my iPhone so please excuse the spelling!" > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >-- OpenPGP: https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1 If you wish to request my time, please do so using *bit.ly/hd1AppointmentRequest <http://bit.ly/hd1AppointmentRequest>*. Si vous voudrais faire connnaisance, allez a *bit.ly/hd1AppointmentRequest <http://bit.ly/hd1AppointmentRequest>*. <https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1>Sent from my mobile device Envoye de mon portable [[alternative HTML version deleted]]
Don't! Well, I know that being a wiseguy is not helpful, but this "advice" is actually not entirely unhelpful. Search on "input Excel file" or similar on rseek.org to bring up many links, including the readxl package, tutorials, the R data import/export manual, etc. However, excel files are notoriously "unstructured," and you would probably be better off converting your data in tabular form to a .csv or .txt file and reading in from there (using read.table, read.csv, etc.) . The linked references (and advice from others with more experience) should be consulted for details. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Jan 10, 2019 at 1:40 PM Bernard Comcast < mcgarvey.bernard at comcast.net> wrote:> What is the best way to read in data of any type from an Excel 2016 .xlsx > file? > > Thanks > > Bernard > Sent from my iPhone so please excuse the spelling!" > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >[[alternative HTML version deleted]]
read.xlsx() works well if the xlsx-file has not too much joined cells. Particularly in the latter case I would recommend to convert the xlsx-file into csv format and then read.csv(). Greetings Albrecht -- Albrecht Kauffmann alkauffm at fastmail.fm Am Do, 10. Jan 2019, um 22:43, schrieb Hasan Diwan:> https://cran.r-project.org/web/packages/xlsx/xlsx.pdf > > You'll need the JDK (>= 1.6) -- H > > On Thu, 10 Jan 2019 at 13:40, Bernard Comcast <mcgarvey.bernard at comcast.net> > wrote: > > > What is the best way to read in data of any type from an Excel 2016 .xlsx > > file? > > > > Thanks > > > > Bernard > > Sent from my iPhone so please excuse the spelling!" > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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. > > > > > -- > OpenPGP: > https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1 > If you wish to request my time, please do so using > *bit.ly/hd1AppointmentRequest > <http://bit.ly/hd1AppointmentRequest>*. > Si vous voudrais faire connnaisance, allez a *bit.ly/hd1AppointmentRequest > <http://bit.ly/hd1AppointmentRequest>*. > > <https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1>Sent > from my mobile device > Envoye de mon portable > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
The way I have done it in the past is to convert to an CSV file. One advantage of this approach is that should my r script accidental write to the file, my original Excel file is not damaged. Bob Sherry On 1/10/2019 4:39 PM, Bernard Comcast wrote:> What is the best way to read in data of any type from an Excel 2016 .xlsx file? > > Thanks > > Bernard > Sent from my iPhone so please excuse the spelling!" > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >