list subselect by name ? ------------------------- I have this 'list of two elements of named elements.'
> list(letters=letters, LETTERS=LETTERS)[c("letters","LETTERS")] $letters [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" [20] "t" "u" "v" "w" "x" "y" "z" $LETTERS [1] "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" [20] "T" "U" "V" "W" "X" "Y" "Z" > str( list(letters=letters, LETTERS=LETTERS)[c("letters","LETTERS")] ) List of 2 $ letters: chr [1:26] "a" "b" "c" "d" ... $ LETTERS: chr [1:26] "A" "B" "C" "D" ... What code do I need to write in place of ?????????????????? to return a 'list of one element that is named.' > list(letters=letters, LETTERS=LETTERS)???????????????????? $LETTERS [1] "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" [20] "T" "U" "V" "W" "X" "Y" "Z" > str( list(letters=letters, LETTERS=LETTERS)???????????????????? ) List of 1 $ LETTERS: chr [1:26] "A" "B" "C" "D" ... Thanks, Andre Mikulec andre_miku...@hotmail.com [[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.