Nothing
library( "easyrodbcexcel" )
# System check. Ingnore this or set 'testODBC' to TRUE
testODBC <- (class(try(odbcDataSources())) != "try-error") & # Check (R)ODBC
(Sys.info()[[ "sysname" ]] == "Windows") & # Only MS Windows
(.Machine$"sizeof.pointer" == 4) # Only 32-bits
### Windows only:
if( testODBC ){
### Make a copy of Excel example file:
# (a database of soil profile description)
file.copy(
from = system.file( "soils.xls", package = "easyrodbcexcel" ),
to = "soils.xls"
)
# soils.xls is now in your working directory.
library( "RODBC" ) # Because soils.db is a SQLite database...
### Describe the database (NB: this is not a connection)
myDb <- edb( dbType = "RODBC_Excel", dbName = "soils.xls" )
### Use the database:
# List the tables:
edbNames( myDb )
### Clean-up
file.remove( "soils.xls" )
### Access 2007 ---------------------------------------------
file.copy(
from = system.file( "soils.xlsx", package = "easyrodbcexcel" ),
to = "soils.xlsx"
)
# soils.db is now in your working directory.
library( "RODBC" ) # Because soils.db is a SQLite database...
### Describe the database (NB: this is not a connection)
myDb2 <- edb( dbType = "RODBC_Excel", dbName = "soils.xlsx",
excelVersion = 2007 )
### Use the database:
# List the tables:
edbNames( myDb2 )
### Clean-up
file.remove( "soils.xlsx" )
} #
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.