Re: [R] xlsx problem

From: Steven McKinney <smckinney_at_bccrc.ca>
Date: Mon, 28 Mar 2011 18:16:02 -0700

Dear Christoph

Are there formulas in any cells of sheet 6?

One thing you might try is to open up the spreadsheet in Excel and create a new sheet, call it Sheet 7.

In Sheet 6, select all the cells with data (or just click the upper left icon at the border of the spreadsheet that selects the whole sheet, <Control>-a will also do this), then go to sheet 7 and do a Paste Special - Values

If you just paste the values, then save the file and read Sheet 7, does that work?

While you're in the spreadsheet, see if you can spot any odd looking entries on sheet 6. Excel lets people put just about anything, just about anywhere.

Steven McKinney



From: r-help-bounces_at_r-project.org [r-help-bounces_at_r-project.org] On Behalf Of Martin Knapp [mkna005_at_aucklanduni.ac.nz] Sent: March 28, 2011 1:43 PM
To: r-help
Subject: [R] xlsx problem

Dear list,
I'm running windows xp with R 2.12.0. I'm trying to load a excel spreadsheet into R using the xlsx package. I posted my code below with the error I get.

> res <- read.xlsx("Copy of test_excel_input_data.xlsx", 6)
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :   java.lang.IllegalStateException: Cannot get a numeric value from a text cell

There are 6 sheets in that file. 5 of them are read into a dataframe without problem. For the 6th one(the one I actually need) I get this error message.
There is obviously something in the format of the sheet wrong. Has anyone an idea whats going wrong and what I have to change in the sheet?

Thanks in advance,

Christoph



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.

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. Received on Tue 29 Mar 2011 - 01:25:16 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 29 Mar 2011 - 01:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive