### Pull reported files
reportedFun <- function(dat,yr,rep_code){
f <- dat
f$INCCAN <- f[[paste0("INCCAN",yr)]]
f$report <- 0
f$report[f$INCCAN %in% rep_code] <- 1
f <- f[,c("ID","report")]
f <- f[f$report==1,]
names(f) <- c("ID",paste0("report",yr))
f <- f[!duplicated(f$ID),]
return(f)
}
otherRepFun <- function(dat,yr,rep_code){
f <- dat
f$INCCAN <- f[[paste0("INCCAN",yr)]]
f$othrep <- 0
f$othrep[!f$INCCAN %in% rep_code] <- 1
f <- f[f$othrep==1,c("ID","othrep")]
names(f) <- c("ID",paste0("othrep",yr))
return(f)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.