I have R installed in a usb stick (since I'm using work computer and don't have Admin access to install software), and so far I've been having to resort to read.csv() since I can't use any library to read excel files. For example, XLConnect gives the problem of :
>Error: package or namespace load failed for ‘XLConnect’:
>> .onLoad failed in loadNamespace() for 'rJava', details:<br>
>> call: inDL(x, as.logical(local), as.logical(now), ...)<br>
>> error: unable to load shared object 'D:/R/R-4.0.2/library/rJava/libs/x64/rJava.dll':<br>
> LoadLibrary failure: %1 is not a valid Win32 application.<br>
>In addition: Warning message:
>package ‘XLConnect’ was built under R version 4.0.3
It seems that these libraries (readxl, xlsx, or XLConnect) are failing because they don't know where I have Java installed. So, I also did this:
Sys.setenv(JAVA_HOME='C:\Program Files (x86)\Java\jre1.8.0_131\bin')
but, to no avail. (that advice I got it from https://www.r-statistics.com/2012/08/how-to-load-the-rjava-package-after-the-error-java_home-cannot-be-determined-from-the-registry/)
If someone knows how to read excel files using R from a memory stick - I would really appreciate if they can point north to me.
btw, this is the error when loading xlsx library:
> library(xlsx)
>Error: package or namespace load failed for ‘xlsx’:
>> .onLoad failed in loadNamespace() for 'rJava', details:<br>
>> call: inDL(x, as.logical(local), as.logical(now), ...)<br>
>> error: unable to load shared object 'D:/R/R-4.0.2/library/rJava/libs/x64/rJava.dll':<br>
>> LoadLibrary failure: %1 is not a valid Win32 application.
<br>
>In addition: Warning message:<br>
>package ‘xlsx’ was built under R version 4.0.3
and this is the error when trying to read an excel file with readxl (no problem when loading):
>*Error in loadNamespace(name) : there is no package called ‘cli’*