Skip to content
Back to formatted view

Raw Message

Message-ID: <4B542DF0.8070602@bitwrit.com.au>
Date: 2010-01-18T09:46:24Z
From: Jim Lemon
Subject: using tabble
In-Reply-To: <2277966.471041263806250884.JavaMail.coremail@bj163app95.163.com>

On 01/18/2010 08:17 PM, Fan Dan wrote:
> Dear Helper:
> I am using R to finish a project which is near the dealine.
> Please help me !!!!!
> I need to construct a table. The name of the table is the sequence from 1 to 7 with some missing values arbitrarily.
> For example 1 to 7
> 1    2   3    6   7
> 12  3   45  5   7
>   I want to add the missing numbers of the title which should be seq(1,7)
> In this case, 4  and 5
> and the corresponding data is 0
> So after revised the table should be like
>   1    2   3   4   5   6   7
>   12  3  45  0   0   5   7
> Please tell me how

Mozart, Mozart, what are we to do?

Mozartdat<-c(rep(1,12),rep(2,3),rep(3,45),rep(6,5),rep(7,7))
Mozart.table<-tabulate(Mozartdat)
names(Mozart.table)<-1:7
Mozart.table

Jim