inst/tutorials/z_plusDS/code/healthcare.R

###healthcare dataset

library(here)
library(readr)
library(dplyr)

#set these variables
file_name <- "heart.Rds" 
dataframe_name <- "heart" 
dataframe_title <- "Heart Disease Dataset"
dataframe_source <- "This data set dates from 1988 and consists of four databases: Cleveland, Hungary, Switzerland, and Long Beach V."
dataframe_desc <- "The complete data set contains 76 attributes, including a predicted attribute generated by ML models to predict heart failure. However, all published experiments refer to using a subset of 14 attributes, which we will use for this class"
dataframe_about <- "patients" #see line 250
path_to_data <- here::here("inst/tutorials/z_plusDS/data", file_name)
data <- readRDS(path_to_data)
heart <- data #set this object as the same as dataframe_name, makes it available in the learnr chunks

#join
dataframe_join_file_name <- "phx.csv"
dataframe_join_name <- "patient_hx"
dataframe_join_about <- "pseudo-patient histories"
data2 <- read_csv(here::here("inst/tutorials/z_plusDS/data", "phx.csv"))
heart_joined <- read_csv(here::here("inst/tutorials/z_plusDS/data", "phx.csv")) %>%  right_join(heart, by = "patient_id")

#joined
dataframe_joined_name <- "heart_joined"

#heart_joined <- read_csv(here::here("data", dataframe_join_file_name)) %>% 
#  right_join(sym(dataframe_name), by = df_id_name)
BAREJAA/reactivity documentation built on April 16, 2020, 6:57 p.m.