Package XLConnect not installing due to lack of rJava. rJava not available.

Hi - trying to add a rJava package to my 3.4.3 version of R.

trying to add an XLConnect package but fails due to lack of rJava. rJava not available in the packages options

Error message as follows

Warning in install.packages :
dependency ‘rJava’ is not available

There is a binary version available but the source version is later:
binary source needs_compilation
XLConnect 0.2-15 1.0.5 FALSE

Please help

Thank you

i think It's a java version issue.
You can try openxlsx in order to write excel files.
It doesn't use Java at all.

Thank you very much.

I have inherited this code from someone else and I am not very good at coding at all. Is it complicated to swap out the functionality from Java to Openxls?

rJava sometimes can be cumbersome to install.

I am not aware which operating system you are on, but here is a couple of pointers that could get you started with rJava and eventually XLConnect:

So, first make sure you can successfully install "rJava" with install.packages after you setup some java environment. Then installing XLConnect will be very straightforward.

Not really.
The code works by steps:

  • Create/Load the "workbook" object .
  • Create the worsheets where you want to write.
  • Write in the desired worksheet the object you want to export.
  • Save the excel file.
    For example, supose you want to export the object named "table_yyz" in the file "mydata.xlsx", and using the worksheet "Data_1"
addWorksheet(wb, "Data_1")
writeData(wb, "Data_1", tabla_yyz, startCol = 2, startRow = 3, rowNames = TRUE)
saveWorkbook(wb, "mydata.xlsx", overwrite = TRUE)

In WriteData I am exporting on B3.
That's the code.
Remember, with openxlsx you will forget about Java issues when you export some excel file.

This topic was automatically closed 21 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.