0

I am trying to add RSQLite package to Imports instead of Depends in my package. In DESCRIPTION I have:

Imports:
    sqldf,
    RPostgreSQL,
    RSQLite

In NAMESPACE there is:

import(RPostgreSQL)
import(RSQLite)
import(sqldf)

But then when I load my package it fails:

> library(devtools)
> load_all()
Loading mondrianr
Loading required namespace: sqldf
Loading required namespace: tcltk
Loading required namespace: RPostgreSQL
> check()
...
check_table_exists: no visible global function definition for
  'dbDriver'
prepare_infrastructure: no visible global function definition for
  'dbDriver'

This will result in failed examples, because dbDriver is method exported by RSQLite, but RSQLite namespace is not loaded. I've tried to add @importMethodsFrom RSQLite dbDriver, but the result is the same.

What should I try next?

Bryan Hanson
  • 6,055
  • 4
  • 41
  • 78
Tomas Greif
  • 21,685
  • 23
  • 106
  • 155
  • If you are using `roxygen2`, which it sounds like you are, add that as a tag and your question might get additional views. – Bryan Hanson Dec 17 '13 at 13:27
  • Well, I'm not a user of `roxygen2`, in part because I like as little as possible between me and `R`. This could be something really odd like an incomplete final line in your `Imports:`statement. You might try putting all the imports on one line, or changing the order of the imports and see if the problem changes. Beyond that, you might try doing the roxygenize separately and then do the traditional `R --as-cran CMD build pkg` etc and see if the problem is from `dev_tools`. Looking at the help page for `load_all` it is not a perfect drop in for the traditional commands. – Bryan Hanson Dec 17 '13 at 14:12
  • 1
    Here's another thing to consider: Are the 'no visible global function definition` complaints coming when the examples are run, or when the functions are checked? If the examples, you may need to add `require(RSQLite)` to the top of the Rd examples (this is a fairly recent change). And are your `dev_tools` and `R` up to date? – Bryan Hanson Dec 17 '13 at 14:16
  • 3
    `dbDriver` lives in the DBI package... – hadley Dec 17 '13 at 15:34
  • @BryanHanson I've solved it. The solution was to import DBI and then also add `require(RSQLite)` to examples. Thank you for your hints. – Tomas Greif Dec 17 '13 at 15:58

0 Answers0