Skip to content

Instantly share code, notes, and snippets.

@nharrell04
Created November 4, 2016 22:14
Show Gist options
  • Save nharrell04/77c404f8d4f3d4cb3080c665d0432fbc to your computer and use it in GitHub Desktop.
Save nharrell04/77c404f8d4f3d4cb3080c665d0432fbc to your computer and use it in GitHub Desktop.
best <- function(state, outcome){
outcome_data <-read.csv("outcome-of-care-measures.csv", colClasses = "character")
##
state_options <- outcome_data[,7]
if(state %in% state_options){}
else
{
stop("invalid state")
}
if(outcome !="heart attack"){break}
else if(outcome == "heart failure"){break}
else if(outcome == "pneumonia"){break}
else
{
stop("invalid outcome")
}
##
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment