How to install ROracle package?
Asked Answered
D

2

9

I am trying to install ROracle package using install.packages("ROracle") but every time i am getting this message "Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘ROracle’"

These will not be installed

I am not able to find the solution for this, How can i resolve this issue?

Dwinnell answered 25/10, 2016 at 6:34 Comment(2)
Are you on Linux or Windows? For Linux I went through the process today and posted my recipe hereAllergist
Possible duplicate of How to install ROracle package on Windows 7?Prochoras
G
8

from a past post. How to install ROracle package on Windows 7?

Download binary from oracle: http://www.oracle.com/technetwork/database/database-technologies/r/roracle/downloads/index.html

The run the following command in r, substituting the file path:

setwd('xxxxx')   # set to path of download
install.packages('ROracle_1.2-1.zip', repos = NULL)
Then load the library and use the package - you may have to change XXXX to whatever is in your TNS Names:

library('ROracle')
drv <- dbDriver("Oracle")
con <- dbConnect(drv, "USER GOES HERE", "PASSWORD GOES HERE", dbname='XXX')
test connection:

dbReadTable(con, 'DUAL')

was able to install from source and download the pre compiled addin directly from oracle

Goldiegoldilocks answered 25/10, 2016 at 18:36 Comment(1)
this doesn't work for everyone Error: package or namespace load failed for ‘ROracle’ in inDL(x, as.logical(local), as.logical(now), ...):Toponym
C
0

Are you on CentOS7?

I've grappled the issue for a long while and have had to document my findings here. But the bird's-eye view of the process is:

  1. Install oracle instant-client with yum.
  2. Set the OCI_LIB and OCI_INC environment variables.
  3. Run ldconfig.
  4. Call install.packages('ROracle')

It also helps to use a proper package management tool like packrat so that you never have to go through this process ever again.

Cadastre answered 21/6, 2019 at 18:50 Comment(3)
There are some issues blocking CRAN package uploads, so the most recent ROracle driver can be found at oracle.com/technetwork/database/database-technologies/r/roracle/…Eskil
That page requires you to sign-on, though. It's not a repo that you can just curl the file from, and therefore wouldn't be automation-friendly.Cadastre
Indeed, not ideal; but CRAN folk have been remarkably hard to contact to get a resolution on the CRAN package issues.Eskil

© 2022 - 2024 — McMap. All rights reserved.