On 2011-02-16 13:29, Sam Steingold wrote:
how do I create a data frame with the given column names
_NOT KNOWN IN ADVANCE_?
i.e., I have a vector of strings for names and I want to get an _EMPTY_
data frame with these column names.
is it at all possible?


It's not really clear to me what you want to do.
If you want to create a zero-rows dataframe (why?),
here's one way:

 nm <- letters[11:14]
 d <- as.data.frame(
          matrix(nrow = 0, ncol = 4,
              dimnames = list(NULL, nm)))

Peter Ehlers

______________________________________________
R-help@r-project.org 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