My code is:


if(type=="none")

  type2<-"nc"

if(type=="drift")

  type2<-"c"

if(type=="trend")

  type2<-"ct"


I am wondering if there's a concise way to write a mapping from type to
type2, especially when the number of categories is high. Thanks!

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to