roracle-databaseroracle

Installing ROracle


I have downloaded the compiled ROracle package from the Oracle website. I have set my working directory with setwd(). Then I tried to install the package as follows:

install.packages("ROracle-1.3.2.zip", repos=NULL)

It failed and I got the following error message:

Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) : 
  cannot open the connection
In addition: Warning message:
In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
  cannot open compressed file 'ROracle-1.3.2/DESCRIPTION', probable reason 'No such file or directory'

I also tried from command line just in case:

R CMD INSTALL ROracle-1.3.2.zip

It also failed and I got the following error message:

* installing to library 'Z:/R/R-3.6.1/library'
Warning in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
  cannot open compressed file 'ROracle-1.3.2/DESCRIPTION', probable reason 'No such file or directory'
Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
  cannot open the connection

The DESCRIPTION file certainly exists in ROracle-1.3.2.zip. I opened it up and looked at - just a normal DESCRIPTION file.

I am using Windows 7.

How do I install ROracle?


Solution

  • You need to follow the following procedure:

    1. Create a folder called "ROracle" and put the downloaded zip ROracle-1.3.2.zip in there
    2. Unzip the .zip file in the folder. Now you have all the contents of the zip file (including the original zip file) in the ROracle folder that you created in step 1
    3. Remove the original .zip file from the folder. Now the folder "ROracle" you created in step 1 only contains the contents of the original .zip file
    4. Add the "ROracle" folder to a zip file called "ROracle.zip"

    Got down into this solution by comparing hierarchy of earlier ROracle_1.3-1.zip -file which i got working well in earlier R version.

    After following all these steps the outcome is that the DESCRIPTION file can be found in ROracle.zip/ROracle/DESCRIPTION instead of ROracle-1.3.2.zip/DESCRIPTION

    With the newly zip-file from step 4 the installation is a quite straightforward.

    setwd("THEPLACEWHERETHE ROracle.zip file is located)
    install.packages('ROracle.zip', repos = NULL)
    

    My .Renviron contains these lines if that matters

        # PATH="C:/Rtools/bin;C:/oracle/instantclient_19_5;$PATH"
        # OCI_LIB64 = C:/oracle/instantclient_19_5
        # BINPREF="C:/Rtools/mingw_$(WIN)/bin/"
    

    OS is WIN10. R version 3.6.2 (2019-12-12) -- "Dark and Stormy Night" Platform: x86_64-w64-mingw32/x64 (64-bit) ROracle 1.3-2