Dear R community, I wish to include a variable (e.g. slice of "a" below) in another variable's name. My objective would be to get a variable-name "data_A" and so on. How can I do this?
> a<-LETTERS[1:25] > a [1] "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" > paste("data_",a[1])<-c(1,2,3) Error in paste("data", a[1]) <- c(1, 2, 3) : target of assignment expands to non-language object Thank you and wishing you an excellent day! Georg. ********************** Georg Ehret Johns Hopkins Baltimore, MD USA [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list 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.