Entering edit mode
3.9 years ago
rheab1230
▴
150
I am trying to install dbDriver package in linux using conda but its showing error. The command used:
conda install -c r r-dbi
The script which require this package(first few lines):
#!/bin/R
"%&%" <- function(a,b) paste(a,b, sep='')
driver <- dbDriver('SQLite')
model_summaries <- read.table('/home/Model_training_chr22_model_summaries.txt',header = T, stringsAsFactors = F)
The error: Error in dbDriver("SQLite") : could not find function "dbDriver" Execution halted (train)
Then I went ahead and install rsqlite package to see if that works. The command used:
conda install -c conda-forge r-rsqlite
The error: Error: Couldn't find driver SQLite. Looked in:
- global namespace
- in package called SQLite
- in package called RSQLite Execution halted
Hi,
Did you import the package where the function
dbDriver()is provided? (Which I guess isDBIafter searching - link)You might have more errors/problems, but the error message
could not find function "dbDriver"suggests that you didn't import/load the packageDBI.So, please import and check if that works by doing one of two things:
2.
Let us know if this worked for you!
António
Hello, I tried the above suggestion. So now my script looks like:
But I am still getting the error:
Can you try to install inside R the package
RSQLiteinstead using conda by typing one of the commands (the 1st tries to install fromCRAN, and the 2nd that relies on the packagedevtoolstries to install from the latest version from the GitHub repository):In your script you just need to load the whole package (
library("DBI")) or load only the function that you need to use from the package (withDBI::dbDriver('SQLite')), not both (although it doesn't hurt!).