# Add the EVT norms table to the norms databaset to faciliate look-up of
# percentiles down the line.
library("L2TDatabase")
library("readr")
library("dplyr")
library("tidyr")
source("inst/paths.R")
# Load hand-entered table of scores
norms <- read_csv(paths$evt_norms)
# Connect to norms database
cnf_file <- "inst/l2t_db.cnf"
norm_db <- l2t_connect(cnf_file, "norms")
# Make sure only new data is being added
current_rows <- tbl(norm_db, "EVT2") %>% collect
new_rows <- anti_join(norms, current_rows) %>%
arrange(Form, Age, Raw)
# Add to database
append_rows_to_table(norm_db, "EVT2", new_rows)
# Check that remote_rows minus local_rows is empty
current_rows <- tbl(norm_db, "EVT2") %>% collect
leftover_rows <- anti_join(norms, current_rows)
## Demos of how to use the norms
norms <- current_rows %>%
select(-EVT2ID)
# General filtering
norms %>%
filter(Raw == 30, Age %in% c(30, 40, 50))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.