if A, B and C are of matrix class:

C <- cbind(x=A[, 1], n=B[, 2])


if A, B and C are of data.frame class:

C <- cbind.data.frame(x=A$x, n=B$n)
C <- data.frame(x=A$x, n=B$n)




linda.s a écrit :

>what is the difference between the two matrix B and C?
>  
>
>>B
>>    
>>
>  m n
>1 1 2
>2 7 8
>  
>
>>C <- cbind(x=A[, 1], n=B[, 2])
>>C
>>    
>>
>     x n
>[1,] 1 2
>[2,] 3 8
>
>For B, it use 1 and 2 to indicate rows while C use[1,] and [2,]
>
>On 3/23/06, Jacques VESLOT <[EMAIL PROTECTED]> wrote:
>  
>
>>C <- cbind(x=A[, 1], n=B[, 2])
>>
>>
>>
>>    
>>
>
>  
>

______________________________________________
[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

Reply via email to