RSQL
Allows the user to generate and execute select, insert, update and delete 'SQL' queries the underlying database without having to explicitly write 'SQL' code.
Release | Usage | Development |
---|---|---|
How to get started
install.packages("RSQL")
How to get started (Development version)
Install the R package using the following commands on the R console:
devtools::install_github("rOpenStats/RSQL", build_opts = NULL)
library(RSQL)
A simple example
To get started execute the following commands:
# 0. Load libraries
library(RSQL)
# 1. RSQL
db.name <- getMtcarsdbPath()
rsql <- createRSQL(drv = RSQLite::SQLite(), dbname = db.name)
query_sql <- rsql$gen_select(
select_fields = c("*"),
table = "mtcars")
query_sql <- rsql$gen_select(
select_fields = c("mpg", "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am"),
table = "mtcars",
where_fields = "gear",
where_values = 4)
mtcars.observed <- rsql$execute_select(query_sql)
Troubleshooting
Please note that the 'RSQL' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.