Error load excel file in to Rmarkdown

Hi community,
Im try to load this data in Rmarkdown but show this error. Never I has see it .

But when I load in normal script is well. :thinking:

accesio <- read_excel("D:\\OneDrive - CGIAR\\Documents\\R\\Mapas\\Revision Coordenadas_Frijol\\Accesiones_MAL_coordenadas.xlsx", sheet = 'CASSAVA2')

Im try with library(xlsx)

accesion<- read.xlsx("D:\\OneDrive - CGIAR\\Documents\\R\\Mapas\\Revision Coordenadas_Frijol\\Accesiones_MAL_coordenadas.xlsx", sheetIndex = 'CASSAVA2', header=TRUE)
#show this Error
# Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : 
# java.lang.OutOfMemoryError: GC overhead limit exceeded

Some ideas?

1 Like

The column types guessed by readxl seem to be off. One problem is that columns D and G seem to use . as the decimal separator while the other numeric columns use , as the decimal separator.
You could try forcing the column types using the col_types argument, like this:

accesio <- read_excel("~/R/Play/casava.xlsx", sheet = 1,
                      col_types = c("text","numeric","numeric","numeric",

You will still get warnings about the "text" in columns D and G being coerced to numeric.

1 Like

Was the solution, I dont have the rule when load the data set the col_types but in the next works Im put more attention in this.

Yes, that was very strange behavior by readxl::read_excel(). I am very surprised it guessed that some columns were of the type logical. I expect that most of the time its guesses are better than on this file.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.