I want to build a package that involves loading data from mysql using different packages depending on the user's system.
For a windows user it would be through an ODBC connection via package RODBC, while a linux/mac user would use the RMySQL package.
In a script, the following works very well:
if(.Platform$OS.type == "unix") {
library(RMySQL)
} else {
library(RODBC)
}
Now I would like to have these packages loaded at the loading of my package. I would normally add it in the DESCRIPTION file, under 'Depends:', but this doesn't allow the optional clause.
What is the best way to handle this ?