library(tidyverse)
Running this script will import the datasets you need
source(here::here("code", "healthcare.R"))
heart_joined
dataset to look for the variables we'll be searching withinglimpse(heart_joined)
"auntie" or "aunt"
in their health history?sum(str_count(heart_joined$family_history, "unt"))
sum(str_count(heart_joined$family_history, "^(M|m)other"))
heart_joined
, create a new column called statin
that detects whether or not a patient is on a statin, "and then" filter the dataset to contain only this subgroup of people. Call this new dataframe statin_subgroup
How many people are in this subgroup?
statin_subgroup <- heart_joined %>% mutate(statin = str_detect(medication_hx, "statin")) %>% filter(statin == TRUE) #391 people
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.