I'd like to have a data.frame structured something like the following:

d <- data.frame (
   x=list( c(1,2), c(5,2), c(9,1) ),
   y=c( 1, -1, -1)
)

The reason is this: 'd' is the training data for a machine learning
algorithm.  d$x is the independent data, and d$y is the dependent
data.

In general my machine learning code will work where each element of
d$x is a vector of one or more real numbers.  So for instance, the
same code should work when d$x[1] = 42, or when d$x[1] = (42, 3, 5).
All that matters is that all element within d$x are lists/vectors of
the same length.

Does anyone know if/how I can get a data.frame set up like that?

Thanks,
Christian

______________________________________________
[email protected] mailing list
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.

Reply via email to