I am a secondary school teacher hoping to use R as part of a statistics course
I have used the split()
function on the outcome_of_care
matrix
bystate <- split(outcome_of_care,outcome_of_care$State)
and then obtained the entries with state "TX"
ans <-bystate$TX
but I want be able to change the state name to "CA"
or whatever
This is my effort so far
st <- "TX"
st <- paste("bystate$", st, sep ="")
st
ans <- as.name(st)