0

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)
David Arenburg
  • 89,637
  • 17
  • 130
  • 188

0 Answers0