[R] Can't read xlsx file into R. Seem, Seem to have XLConnect loaded.

David Winsemius dwinsemius at comcast.net
Thu May 10 03:51:18 CEST 2012


On May 9, 2012, at 9:44 PM, David Winsemius wrote:

>
> On May 9, 2012, at 6:38 PM, Mike Hilt wrote:
>
>> I have spent hours on R in Windows 7.  Just installed 2 days ago so  
>> the R
>> package should be current. Currently I am using the RGui (64-bit)  
>> for Windows.
>>
>> I can not read an Excel file into R from my computer.  Have hours  
>> on this.
>> Completely crazy!!
>>
>
> snipped rant.
>
>>
>> So apparently "Oil Dly YTD1204 v01.xlsx" exists in my working  
>> directory.
>>
>> SO WHY DOES THE FOLLOWING BEHAVE THE WAY IT DOES?
>>
>>> OlPrcFl <- loadWorkbook(“Oil Dly YTD1204 v01.xlsx”, create = FALSE)
>
> Most likely you need to quote that file argument. At the moment the  
> interpreter is probably trying to find an object named "Oil" in your  
> workspace. Try
>
> OlPrcFl <- loadWorkbook("“Oil Dly YTD1204 v01.xlsx"”, create = FALSE)

Interesting. Those "smart-quotes" did not appear in Mac Mail.app  
display. I thought the file name was unquoted.

Mike;

This is yet another reason why you _should_ be posting in plain text.  
And stop using MS-Word as your editor.

-- 

>
>>
>> Error: unexpected input in "OlPrcFl <- loadWorkbook(“"
>>
>> I can read an xlsx file in when I do:
>>
>>
>>> OlPrcFl <- loadWorkbook(file.choose())
>>
>> That is not a real, long-term solution.
>>
>>
>> Have same problem installing packages -- Can't get R to load a  
>> package when
>> I specify a path.
>
> Probably the same error, failing to quote when R expects to a  
> character object.
>
>
>> Works when I use file.choose()
>>
>> 	[[alternative HTML version deleted]]
>
> Sigh. I _know_ that gmail will allow you to post in plain text.
>
> -- 
> David Winsemius, MD
> West Hartford, CT
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list