knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(podr)
Database Info:
Host: podr.phuse.global Database: nihpo Port number: 5432 Username: <your user name> Password: <your password>
library(RPostgres) usr <- 'phuse_su67e99huj'; pwd <- 'bGopEaaIQ7uB'; con <- conn_podr(usr,pwd) str(con)
library(tibble) library(stringr) library("DT") # Case 1: use query string to call read_podr qry <- "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"; # cc <- read_podr(con = con, query_string = qry, limit = 1000 ) %>% # add_column(libname = gsub('_[[:alpha:]]+$', '\\1', .[,"table_name"], ignore.case = TRUE )) %>% # add_column(dataset = str_extract(.[,"table_name"], '([[:alpha:]]+)$' )) c1 <- read_podr(con = con, query_string = qry, limit = 1000 ) c2 <- add_column(c1, libname = gsub('_[[:alpha:]]+$', '\\1', c1[,"table_name"], ignore.case = TRUE )) cc <- add_column(c2, dataset = str_extract(c2[,"table_name"], '([[:alpha:]]+)$' )) DT::datatable(cc) # Case 2: read record for a table tb <- 'virtual_css_2020_sdtm_ae' c2 <- read_podr(tabname = tb) DT::datatable(c2) # Case 3: read record for a data set in a library/category lb <- 'virtual_css_2020_sdtm'; ds <- 'cm' c3 <- read_podr(libname = lb, dataset = ds) DT::datatable(c3)
Calls to read_podr and gets a list of tables from PODR.
cc <- get_table_names() datatable(cc)
Calls to read_podr and gets table definition for a table in PODR.
tb <- 'virtual_css_2020_sdtm_ae' rr <- get_table_defs(tb) DT::datatable(rr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.