diff --git a/DESCRIPTION b/DESCRIPTION index b3c3ca3..408c5bb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: door Title: Shiny module for statgarten -Version: 0.4.3 +Version: 0.4.4 Authors@R: person("Jinhwan", "Kim", , "hwanistic@gmail.com", role = c("cre", "aut")) Description: Main application for data analysis using statgarten packages. @@ -13,6 +13,7 @@ Imports: config (>= 0.3.1), data.table (>= 1.14.2), datamods (>= 1.3.3), + DBI (>= 1.1.3), dplyr (>= 1.0.9), DT (>= 0.24), esquisse (>= 1.1.1), @@ -32,6 +33,7 @@ Imports: readxl (>= 1.4.1), remotes, rmarkdown (>= 2.16), + RSQLite (>= 2.3.2), rticles (>= 0.25), scissor, shiny (>= 1.7.1), diff --git a/NAMESPACE b/NAMESPACE index 2ec1d7c..5dc0439 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -10,10 +10,16 @@ import(shiny) import(shiny.i18n) import(shinyWidgets) import(tidyr) +importFrom(DBI,dbConnect) +importFrom(DBI,dbDisconnect) +importFrom(DBI,dbGetQuery) +importFrom(DBI,dbListTables) +importFrom(DBI,dbWriteTable) importFrom(DT,DTOutput) importFrom(DT,datatable) importFrom(DT,formatStyle) importFrom(GGally,ggcorr) +importFrom(RSQLite,SQLite) importFrom(board,mod_distributionModule_server) importFrom(board,mod_distributionModule_ui) importFrom(colorpen,mod_mapVisModule_server) diff --git a/R/app_server.R b/R/app_server.R index 24bc0b7..c99f183 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -38,6 +38,8 @@ #' #' @import datamods #' @import rmarkdown +#' @importFrom DBI dbConnect dbWriteTable dbListTables dbGetQuery dbDisconnect +#' @importFrom RSQLite SQLite #' @noRd app_server <- function(input, output, session) { @@ -506,7 +508,7 @@ app_server <- function(input, output, session) { ".csv", ".dta", ".fst", ".rda", ".rds", ".rdata", ".sas7bcat", ".sas7bdat", ".sav", ".tsv", ".txt", ".xls", ".xlsx", - ".xml", ".json" + ".xml", ".json", ".sqlite" ) ) }) @@ -604,6 +606,13 @@ app_server <- function(input, output, session) { }, json = function(file) { jsonlite::fromJSON(file) + }, + sqlite = function(file){ + con <- dbConnect(SQLite(), file) + tableName <- dbListTables(con) + res <- dbGetQuery(con, paste0("SELECT * FROM ", tableName)) + dbDisconnect(con) + return(res) } ) ) diff --git a/examples/iris.rda b/examples/iris.rda index ae3cf4b..df167f0 100644 Binary files a/examples/iris.rda and b/examples/iris.rda differ diff --git a/examples/iris.sqlite b/examples/iris.sqlite new file mode 100644 index 0000000..6e91e1c Binary files /dev/null and b/examples/iris.sqlite differ diff --git a/man/init.Rd b/man/init.Rd index 08efc09..259d608 100644 --- a/man/init.Rd +++ b/man/init.Rd @@ -14,6 +14,6 @@ Install statgarten dependencies, datatoys, board, scissor, colorpen, soroban, st } \examples{ \dontrun{ - init() +init() } }