[R] correct syntax

venomousanimal venomousanimal at web.de
Wed Sep 28 23:26:54 CEST 2005


Stephen Choularton schrieb:

>Hi 
> 
>I am trying to produce a little table like this:
> 
>0                     1
>0          601       408
>1          290       2655
> 
>but I cannot get the syntax right.  
> 
>Can anyone help.
> 
>Stephen
>
>  
>
 > vec1= c(0,0,1)
 > vec2= c(NA,601,290)
 > vec3= c(1,408,2655)
 > table = as.table(cbind(vec1,vec2,vec3))
 > table
  vec1 vec2 vec3
A    0         1
B    0  601  408
C    1  290 2655

Greetz, Sonja




More information about the R-help mailing list