Skip to content
Prev 17674 / 63424 Next

Lists and data frames (PR#8143)

On Mon, 2005-09-19 at 15:34 +0200, fwagner at fh-lausitz.de wrote:
You need to use [[x]] to subset a list:
[[1]]
[[1]]$value1
[1] 3

[[1]]$value2
[1] 5
List of 1
 $ :List of 2
  ..$ value1: num 3
  ..$ value2: num 5

I don't know whether there is a typo on page 27 or not: [x] is valid, it
just means something different to [[x]] - as explained on page 26 of
said manual. If it was intentional, then IMHO it is not the most clear
example of extending a list - the [[x]] notation is what I would expect
to have to use - after reading page 26 of course...

HTH

G