Forum Stats

  • 3,854,206 Users
  • 2,264,340 Discussions
  • 7,905,609 Comments

Discussions

ROracle for R 4.0.0 or newer

User_9S1FH
User_9S1FH Member Posts: 2 Green Ribbon

Hi!


It currently seems that the latest R versions that are supported by the ROracle are 3.6.x versions. Is there going to be package with R version 4.0.x support? Or is there workaround to use current ROracle versions with R 4.0.x?

Latest versions from downloads page were checked at 13/01/2022 from here: https://www.oracle.com/database/technologies/roracle-downloads.html


With friendly regards,

Pekka

User_5N9XO

Best Answer

  • Corey N
    Corey N Member Posts: 2 Red Ribbon
    Answer ✓

    The issue, I believe, is that ROracle has to be built from source because, as noted above, the version on CRAN was built under R version 3.5.x. The CRAN package prompts me to build from source, but it has failed at times.

    When that has happened, I've had luck using the tar.gz file available from the link User_9S1FH posted above. And if you want ROracle version 1.3-2, you have to go that route regardless at this point in time:

    https://community.oracle.com/tech/developers/discussion/4272736/roracle-1-3-2-is-available-on-otn

    There are various ways to install the .tar.gz file. I tend to use the install_local() function from the remotes package. With the tar.gz file in your working director, you would do it like so:

    remotes::install_local("ROracle_1.3-2.tar.gz", repos = NULL, type = "source")
    

    In updating to R version 4.2 last week, even that was failing. I'm a Windows 10 user. I think the failure had to do with not having the last version of RTools installed, which is version 4.2 as well:

    After updating RTools, ROracle installed successfully. RTools is what Windows users need to compile packages from source.

Answers

  • User_5N9XO
    User_5N9XO Member Posts: 1 Green Ribbon

    I'm also trying to migrate to R 4.0+ and am running into the same issue.

    Would appreciate any updates possible on whether this package will be updated.

  • Corey N
    Corey N Member Posts: 2 Red Ribbon
    Answer ✓

    The issue, I believe, is that ROracle has to be built from source because, as noted above, the version on CRAN was built under R version 3.5.x. The CRAN package prompts me to build from source, but it has failed at times.

    When that has happened, I've had luck using the tar.gz file available from the link User_9S1FH posted above. And if you want ROracle version 1.3-2, you have to go that route regardless at this point in time:

    https://community.oracle.com/tech/developers/discussion/4272736/roracle-1-3-2-is-available-on-otn

    There are various ways to install the .tar.gz file. I tend to use the install_local() function from the remotes package. With the tar.gz file in your working director, you would do it like so:

    remotes::install_local("ROracle_1.3-2.tar.gz", repos = NULL, type = "source")
    

    In updating to R version 4.2 last week, even that was failing. I'm a Windows 10 user. I think the failure had to do with not having the last version of RTools installed, which is version 4.2 as well:

    After updating RTools, ROracle installed successfully. RTools is what Windows users need to compile packages from source.

  • User_9S1FH
    User_9S1FH Member Posts: 2 Green Ribbon
    edited Jul 26, 2022 5:49AM

    Thank you Corey N!

    Your answer helped to install the ROracle with the new version of R 4.2.1 with windows 10. I used the remotes::install_local function to install the package from source. Some additional advises below for others who are trying to install the package.

    1. Get and install the new version of R.
    2. Install the new version from R tools. In my case it was the version 4.2 like Corey stated in post above https://cran.r-project.org/bin/windows/Rtools/rtools42/rtools.html.
    3. Get new version of Oracle Instant Client and install it into folder (I used location C:\Oracle\instantclient_18_5 and I happened to have old Instant client version 18_5 but feel free to use new version) https://www.oracle.com/database/technologies/instant-client/downloads.html
    4. Get new version from sdk package for the Instant client https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html (I had to install older version that supports 18_5). Make sure to extract sdk package into instant client folder. So in my case into folder C:\Oracle\instantclient_18_5\sdk.
    5. Open your "Environment Variables" from your windows 10 and add variable "OCI_LIB64" with same value where your Instant client is located (in my case C:\Oracle\instantclient_18_5)
    6. Download new version of ROracle (ROracle_1.3-2.tar.gz) https://www.oracle.com/database/technologies/roracle-downloads.html and store it into document folder. At least in my case remotes::install_local function called the package from that location. When you try to run the install command in R the remotes::install_local will give you warning where it is trying to find ROracle if it cannot find it.
    7. Open R and install needed packages and finally the ROracle with the help from remotes package.

    # R code

    # Needed packages

    install.packages("codetools") # is this part of base R? might not need additional installation??

    install.packages("remotes")

    remotes::install_local("ROracle_1.3-2.tar.gz", repos = NULL, type = "source")


    Here is how the created "OCI_LIB64" variable looks in my machine