[R-sig-teaching] Read *.xlsx data file into R

Randall Pruim rpruim at calvin.edu
Wed Sep 23 16:28:01 CEST 2015


But be warned that depending on the kinds of data you have, exporting to CSV and then reading in the CSV may or may not give you exactly what you are expecting.  So it is safer to use a tool designed to read excel files directly if (a) you can make it work and (b) the tool you are using is good at dealing with excel data issues.  (I’m not familiar with xslx, so I can’t comment on how well it works or what might be causing you problems in your case.)

Also, I would use either read.csv() or readr::read_csv() to read a csv file if you do go that route.

On Sep 23, 2015, at 10:15 AM, David Pell <David.Pell at mrc-hnr.cam.ac.uk<mailto:David.Pell at mrc-hnr.cam.ac.uk>> wrote:


Alternatively you could save the xslx as a csv then use the read.table

df = read.table("myfile.csv", header = TRUE)

David



	[[alternative HTML version deleted]]



More information about the R-sig-teaching mailing list