[R] Having trouble with gdata read in
Benjamin Baker
bbaker at reed.edu
Wed Mar 25 22:01:49 CET 2015
Trying to read and clean up the FERC data on Advanced Metering infrastructure. Of course it is in XLS for the first two survey years and then converts to XLSX for the final two. Bad enough that it is all in excel, they had to change the survey design and data format as well. Still, I’m sorting through it. However, when I try and read in the 2008 data, I’m getting this error:
###
Wide character in print at /Library/Frameworks/R.framework/Versions/3.1/Resources/library/gdata/perl/xls2csv.pl line 270.
Warning message:
In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
EOF within quoted string
###
Here is the code I’m running to get the data:
###
install.packages("gdata")
library("gdata")
fileUrl <- "http://www.ferc.gov/industries/electric/indus-act/demand-response/2008/survey/ami_survey_responses.xls"
download.file(fileUrl, destfile="./ami.data/ami-data2008.xls")
list.files("ami.data")
dateDown.2008 <- date()
ami.data2008 <- read.xls("./ami.data/ami-data2008.xls", sheet=1, header=TRUE)
###
Reviewed the data in the XLS file, and both “” and # are present within it. Don’t know how to get the read.xls to ignore them so I can read all the data into my data frame. Tried :
###
ami.data2008 <- read.xls("./ami.data/ami-data2008.xls", sheet=1, quote="", header=TRUE)
###
And it spits out “More columns than column names” output.
Been searching this, and I can find some “solutions” for read.table, but nothing specific to read.xls
Many thanks,
Benjamin Baker
—
Sent from Mailbox
[[alternative HTML version deleted]]
More information about the R-help
mailing list