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.1-11.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")
# NOTE: never store passwords in a saved script!!
con <- dbConnect(drv, "USER GOES HERE", "PASSWORD GOES HERE", dbname='XXX')
test connection:
dbReadTable(con, 'DUAL')
Installation of ROracle is a bit tricky.
Download ROracle package on your PC: https://www.oracle.com/database/technologies/roracle-downloads.html
Download the tar.gz package!
Access the INSTALL file on ROracle sub-directory and follow the instructions. The installation differs if you have or not Oracle installed on your machine.
Good instructions in: # https://medium.com/analytics-vidhya/how-to-install-roracle-on-windows-10-144b0b923dac
IMPORTANT
ROracle can't be directly installed on R4+
So, download ROracle package on your PC: https://www.oracle.com/database/technologies/roracle-downloads.html
Download the tar.gz package!
Install it on your RStudio with the following command:
install.packages('C:\Downloads\ROracle_1.3-2.tar.gz', repos = NULL, type="source")
Don't forget to correct the directory in which you've downloaded the file. This will recompile your package to version 4 of R.