I need to convert a dataframe to a record-structure, to be able to encode it
later in JSON. Suppose this is the data:
mydata - data.frame(foo=1:3, bar=c(M,M,F));
I would like to convert this to a unnamed list (json array) of key-value
pairs. For example like this:
apply(data.frame(foo=1:3,
On 2011-05-21 23:11, Jeroen Ooms wrote:
I need to convert a dataframe to a record-structure, to be able to encode it
later in JSON. Suppose this is the data:
mydata- data.frame(foo=1:3, bar=c(M,M,F));
I would like to convert this to a unnamed list (json array) of key-value
pairs. For example
apply() operates on arrays and a data frame will be coerced to a matrix
(which requires all elements to be of the same type). This is documented in
?apply.
Thanks, I was not aware of that. I implicitly assumed there would be a
specific apply.data.frame.
This may not be elegant, but why
On May 22, 2011, at 3:22 PM, Jeroen Ooms wrote:
apply() operates on arrays and a data frame will be coerced to a
matrix
(which requires all elements to be of the same type). This is
documented in
?apply.
Thanks, I was not aware of that. I implicitly assumed there would be a
specific
On May 22, 2011, at 2:11 AM, Jeroen Ooms wrote:
I need to convert a dataframe to a record-structure, to be able to
encode it
later in JSON. Suppose this is the data:
mydata - data.frame(foo=1:3, bar=c(M,M,F));
I would like to convert this to a unnamed list (json array) of key-
value
On May 22, 2011, at 3:40 PM, David Winsemius wrote:
On May 22, 2011, at 2:11 AM, Jeroen Ooms wrote:
I need to convert a dataframe to a record-structure, to be able to
encode it
later in JSON. Suppose this is the data:
mydata - data.frame(foo=1:3, bar=c(M,M,F));
I would like to convert
6 matches
Mail list logo