# # Global settings # url <- getOption("opal.url", "https://demo.obiba.org:8443") username <- getOption("opal.username", "administrator") password <- getOption("opal.password", "password") datasource <- getOption("opal.datasource", "mica_demo") table <- getOption("opal.table", "FNAC") withStatistics <- getOption("opal.withStatistics", TRUE) withGraphs <- getOption("opal.withGraphs", TRUE)
# set up dictionary and data library(opal) o <- opal.login(username, password, url) variables <- opal.variables(o, datasource, table) t <- opal.table(o, datasource, table, counts=TRUE) if (withStatistics | withGraphs) { opal.execute(o, 'require(e1071)') opal.assign(o,'D', paste0(datasource, ".", table)) } if (withGraphs) { require(ggplot2) opal.execute(o, 'require(ggplot2)') }
r table
Data DictionaryName of the report | Data Dictionary for r table
---------------------- | -------------------
Project | r datasource
Table | r table
Number of variables | r t$variableCount
Number of participants | r t$valueSetCount
Date | r as.character(Sys.Date())
for (variable in variables) { cat(paste0("* [", variable$name, "](#", gsub("\\.","_",variable$name),")\n")) }
out <- NULL for (variable in variables) { out <- c(out, knit_child('opal-variable.Rmd'), sep='\n') }
r paste(out, collapse='\n')
opal.logout(o)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.