R-alpha: cbind for data frames

Anthony Ledford (mas2al@mcs.surrey.ac.uk)
Tue, 26 Nov 1996 10:21:40 +0000 (GMT)


Date: Tue, 26 Nov 1996 10:21:40 +0000 (GMT)
From: Anthony Ledford <mas2al@mcs.surrey.ac.uk>
To: r-testers@stat.math.ethz.ch
Subject: R-alpha: cbind for data frames

The following details an incompatibility between Splus and R0.13.

Data file: exams.txt

    name   age   mark1   mark2   mark3  
 1 arthur  21      78     77       56
 2 barry   22      85     65       81
 3 charlie 19      56     66       85
 4 dave    22      75     75       54

I read this in as a data frame:
students <-read.table("exams.txt",as.is=T)

Then try to add another mark:
students <- cbind(students,mark4=c(58,76,66,65))  

This works with Splus but gives me the following error in Rv0.13 
(on a SPARC 20 running Solaris):

Error in cbind(students, mark4 = c(58, 76, 66, 65)) : cannot create a
matrix from these types

Cheers, Anthony.


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-