Skip to content

Variables from a Dataframe

4 messages · Jose Bustos Melo, Sarah Goslee, Paul Menzel +1 more

#
Without a reproducible example it's impossible to say for certain,
but I'd try
cbind.data.frame() instead of cbind().

You need to have a data frame, not a matrix, for the result.

Sarah
On Mon, Dec 12, 2011 at 2:44 PM, Jose Bustos Melo <jbustosmelo at yahoo.es> wrote:

  
    
#
Dear Jose,


Am Montag, den 12.12.2011, 19:44 +0000 schrieb Jose Bustos Melo:
please provide a reproducible example as written in the posting guide.

[?]
Read [1] to just send plain text messages.


Thanks,

Paul


[1] http://email.about.com/od/yahoomailtips/qt/et_plain_text.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111212/3332db2c/attachment.bin>
#
I would recommend using data.frame(var1, var2, ...)
and not cbind.data.frame(var1, var2, ...).  I consider
it bad form to directly call a method of a generic function.
Sometimes it leads to errors, as a method should be
free to assume that its inputs are of the class it
was declared to accept.   In the particular case of
cbind.data.frame, I think it just calls data.frame.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com