Message-ID: <Pine.SOL.3.96.1040117014906.3256C-100000@libra.cus.cam.ac.uk>
Date: 2004-01-17T02:02:22Z
From: Damon Wischik
Subject: Weird problem with trying to change a variable
In-Reply-To: <Pine.LNX.4.44.0401162153420.30845-100000@gannet.stats>
> Lists? Do you mean vectors? Columns of dataframes are not supposed to be
> lists.
Ah. I've been using commands like
> x <- list(c(1,2,3),c(2,1),c(6,6,1))
> y <- c("A","B","C")
> data.frame(I(x),y)
x y
1 1, 2, 3 A
2 2, 1 B
3 6, 6, 1 C
This sort of object behaves pretty much as I'd expect it to (using R 1.8.0
for Windows), though I've only made limited use. The x column has mode
list but class AsIs. Is this a legitimate use?
(The documentation tells me that as.data.frame is a generic method, with
many implementations, including one for AsIs; and that the function I will
accept any object. I haven't looked into the implementation.)
Damon.