[R] Having trouble with gdata read in

Benjamin Baker bbaker at reed.edu
Fri Mar 27 20:52:55 CET 2015


Anthony,




XLSX won’t read an XLS file. Additionally, the legacy Java that is required for the xlsx package really effs up my computer. Have to reinstall my OS to fix it.




—
Sent from Mailbox

On Wed, Mar 25, 2015 at 3:51 PM, Anthony Damico <ajdamico at gmail.com>
wrote:

> maybe
> library(xlsx)
> tf <- tempfile()
> ami <- "
> http://www.ferc.gov/industries/electric/indus-act/demand-response/2008/survey/ami_survey_responses.xls
> "
> download.file( ami , tf , mode = 'wb' )
> ami.data2008 <- read.xlsx( tf , sheetIndex = 1 )
> On Wed, Mar 25, 2015 at 5:01 PM, Benjamin Baker <bbaker at reed.edu> wrote:
>> 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]]
>>
>> ______________________________________________
>> 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]]



More information about the R-help mailing list