Trouble with the package of "xlsx"

I have the following questions:

For the "rjava" package, it has been sussessful installation, but when i try to update package "xlsx". some errors were happened:

  • installing source package 'xlsx' ...
    ** package 'xlsx' successfully unpacked and MD5 sums checked
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    converting help for package 'xlsx'
    finding HTML links ... done
    Alignment html
    Border html
    Cell html
    CellProtection html
    CellStyle-plus html
    CellStyle html
    Comment html
    DataFormat html
    Fill html
    Font html
    NamedRanges html
    OtherEffects html
    POI_constants html
    Picture html
    PrintSetup html
    Row html
    Sheet html
    Workbook html
    addDataFrame html
    addHyperlink html
    read.xlsx html
    readColumns html
    write.xlsx html
    Rd warning: C:/Users/Ngo Hung/AppData/Local/Temp/RtmpYdCtcr/R.INSTALL15444ef639bf/xlsx/man/write.xlsx.Rd:38: file link 'write.csv' in package 'utils' does not exist and so has been treated as a topic
    xlsx-package html
    ** building package indices
    ** testing if installed package can be loaded
    *** arch - i386
    Error : package 'rJava' is not installed for 'arch = i386'
    Error: loading failed
    Execution halted
    *** arch - x64
    Error: package or namespace load failed for 'xlsx':
    .onAttach failed in attachNamespace() for 'xlsx', details:
    call: .jnew("org/apache/poi/xssf/usermodel/XSSFWorkbook")
    error: java.lang.ClassNotFoundException
    Error: loading failed
    Execution halted
    ERROR: loading failed for 'i386', 'x64'
  • removing 'C:/Users/Ngo Hung/Documents/R/win-library/3.5/xlsx'
    In R CMD INSTALL

Please help me correct this case.

Apparently you don't have a 32 bit version of Java installed, try with this

install.packages('xlsx', type = 'source', INSTALL_opts='--no-multiarch')

Hi, we still do not update:

install.packages('xlsx', type = 'source', INSTALL_opts='--no-multiarch')
Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/src/contrib:
cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'
Installing package into ‘C:/Users/Ngo Hung/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/src/contrib:
cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
package ‘xlsx’ is not available (for R version 3.5.2)

This is a different problem, because xlsx is actualy avalilable for R version 3.5.2 on windows, are you using a different internet connection now? if you are at work there is a chance that your internet connection is behind a proxy server or a firewall.

install.packages('xlsx', type = 'source', INSTALL_opts='--no-multiarch')

trying URL 'https://cran.rstudio.com/src/contrib/xlsx_0.6.1.tar.gz'
Content type 'application/x-gzip' length 315441 bytes (308 KB)
downloaded 308 KB

* installing *source* package 'xlsx' ...
** package 'xlsx' successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'xlsx'
    finding HTML links ... done
    Alignment                               html  
    Border                                  html  
    Cell                                    html  
    CellBlock                               html  
    CellProtection                          html  
    CellStyle-plus                          html  
    CellStyle                               html  
    Comment                                 html  
    DataFormat                              html  
    Fill                                    html  
    Font                                    html  
    NamedRanges                             html  
    OtherEffects                            html  
    POI_constants                           html  
    Picture                                 html  
    PrintSetup                              html  
    Row                                     html  
    Sheet                                   html  
    Workbook                                html  
    addDataFrame                            html  
    addHyperlink                            html  
    autoRefresh                             html  
    read.xlsx                               html  
    readColumns                             html  
    readRows                                html  
    write.xlsx                              html  
Rd warning: C:/Users/andre/AppData/Local/Temp/RtmpygpQ2e/R.INSTALL471848d933de/xlsx/man/write.xlsx.Rd:38: file link 'write.csv' in package 'utils' does not exist and so has been treated as a topic
    xlsx-package                            html  
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (xlsx)
In R CMD INSTALL

The downloaded source packages are in
	‘C:\Users\andre\AppData\Local\Temp\RtmpaU8czi\downloaded_packages’

Thank you so much for your help, but it does not work:

install.packages("C:/Users/Ngo Hung/Desktop/xlsx_0.6.1 (3).tar.gz", repos = NULL, type = "source")
Installing package into ‘C:/Users/Ngo Hung/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)

  • installing source package 'xlsx' ...
    ** package 'xlsx' successfully unpacked and MD5 sums checked
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    converting help for package 'xlsx'
    finding HTML links ... done
    Alignment html
    Border html
    Cell html
    CellBlock html
    CellProtection html
    CellStyle-plus html
    CellStyle html
    Comment html
    DataFormat html
    Fill html
    Font html
    NamedRanges html
    OtherEffects html
    POI_constants html
    Picture html
    PrintSetup html
    Row html
    Sheet html
    Workbook html
    addDataFrame html
    addHyperlink html
    autoRefresh html
    read.xlsx html
    readColumns html
    readRows html
    write.xlsx html
    Rd warning: C:/Users/Ngo Hung/AppData/Local/Temp/Rtmpk3z379/R.INSTALL15821cc9c1/xlsx/man/write.xlsx.Rd:38: file link 'write.csv' in package 'utils' does not exist and so has been treated as a topic
    xlsx-package html
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded
    *** arch - i386
    Error: package or namespace load failed for 'xlsx':
    .onLoad failed in loadNamespace() for 'rJava', details:
    call: library.dynam("rJava", pkgname, libname)
    error: DLL 'rJava' not found: maybe not installed for this architecture?
    Error: loading failed
    Execution halted
    *** arch - x64
    ERROR: loading failed for 'i386'
  • removing 'C:/Users/Ngo Hung/Documents/R/win-library/3.5/xlsx'
    In R CMD INSTALL
    Warning in install.packages :
    installation of package ‘C:/Users/NGOHUN~1/Desktop/xlsx_0.6.1 (3).tar.gz’ had non-zero exit status

You haven't used this option in your command INSTALL_opts='--no-multiarch', this tells R to only test package loading in the main architecture i.e. x64

Done, thank you very much.

Please help me install package "r2excel"
install.packages("C:/Users/Ngo Hung/Desktop/r2excel-master (3).zip", repos = NULL, type = "win.binary")
Installing package into ‘C:/Users/Ngo Hung/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
cannot open compressed file 'r2excel-master (3)/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection

Where did you get that file? it isn't on CRAN, I can't test it because I don't know from where to get that file.
Also, why are you manually downloading your packages?

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.