This tutorial contains the functions the team used to explore and prepare the Longitudinal Tracts Database files used as the raw data source for this project. The “helper_function.R” file can be found in the “analysis” folder in the repository.
# load necessary functions and objects ----
library( here )
library(data.table)
library( dplyr )
library( pander )
library( tidyverse )
library( readr )
library(forecast)
library(knitr)
# store data dictionary file path
<- here::here( "data/rodeo/ltdb_data_dictionary.csv" )
DD_FILEPATH
# import data dictionary
<- read.csv( DD_FILEPATH, stringsAsFactors=F ) dd
# load functions source files
source(here("labs/wk02/helper_function.R"))
filter_data(dd, "ethnicity")
keyword_search(dd, "persons")
variable_years(dd, c("1990", "2000", "2010" ))
<- variable_years(dd, c("1990", "2000", "2010"))
variables
%>% distinct(root) variables
left_join(variables, dd) %>% tail(50)
## Joining, by = "root"