library("knitr")
opts_chunk$set(echo = TRUE)
opts_chunk$set(collapse = TRUE, comment = "#>", message = FALSE)

wd <- rprojroot::find_rstudio_root_file()
opts_knit$set(root.dir = wd)

View a bit of the raw table.

library(dplyr)
library(L2TDatabase)

# Get the HouseholdIDs and ResearchIDs from the database
backend <- l2t_connect(cnf_file = "./inst/l2t_db.cnf", db_name = "backend")

tbl(backend, "Household") %>% 
  collect() %>% 
  head()

Demonstrate a query.

tbl(backend, "Household") %>% 
  left_join(tbl(backend, "Child")) %>% 
  select(ChildID, HouseholdID, Household_FamilyIncome) %>% 
  count(Household_FamilyIncome) %>% 
  collect()


LearningToTalk/L2TDatabase documentation built on June 24, 2020, 3:45 a.m.