[R] How to create a numeric data.frame
Joshua Wiley
jwiley.psych at gmail.com
Mon Jun 13 17:09:43 CEST 2011
On Mon, Jun 13, 2011 at 7:45 AM, Barry Rowlingson
<b.rowlingson at lancaster.ac.uk> wrote:
[snip]
> now you may think it reasonable to do an 'as.numeric' on that, but what about:
>
> as.numeric(list(foo=list(bar=c(1,2,3),baz=c(34,5)),bar=c("Hello","World"))
>
> how would you 'as.numeric' that?
Well, "Hello" is one of the first words spoken when meeting someone
and in programming, and I think "World" represents not just the earth,
but everything that exists. Everything seems best represented by a
continuous circle, so logically I would 'as.numeric' that
$foo
$foo$bar
[1] 1 2 3
$foo$baz
[1] 34 5
$bar
[1] 1 0
However, R does not agree with my logic ;)
Josh
More information about the R-help
mailing list