Update R code

working through the if then to select hospital name.