Given the data:
dat1<-read.table(header=TRUE,text="
ID V1 V2 V3 V4
16532
23221
36532
412 15 32
56832
63241
76533
812 15 31
96533
103275
116
HI,
Sorry, there was a mistake, which I noticed after seeing David's post.
dat1<-read.table(text="
ID V1 V2 V3 V4
1 6 5 3 2
2 3 2 2 1
3 6 5 3 2
4 12 15 3 2
5 6 8 3 2
6 3 2 4 1
7 6 5 3 3
8 12 15 3 1
9 6
HI,
May be this helps:
dat1<-read.table(text="
ID V1 V2 V3 V4
1 6 5 3 2
2 3 2 2 1
3 6 5 3 2
4 12 15 3 2
5 6 8 3 2
6 3 2 4 1
7 6 5 3 3
8 12 15 3 1
9 6 5 3 3
10 3 2 7 5
Hi,
One more way:
dat1<-read.table(text="
ID V1 V2 V3 V4
1 6 5 3 2
2 3 2 2 1
3 6 5 3 2
4 12 15 3 2
5 6 8 3 2
6 3 2 4 1
7 6 5 3 3
8 12 15 3 1
9 6 5 3 3
10 3 2 7 5
11 6 5
ect.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of John Kane
> Sent: Saturday, January 05, 2013 11:23 AM
> To: Simonas Kecorius; r-help@r-project.org
> Subject: Re: [R] Need help on dataframe
>
> Well, a rather simple-minded, brute force approach would be to add a
>
Well, a rather simple-minded, brute force approach would be to add a factor
variable to the data frame and use aggregate on it.
I am sure there are better ways but this will work.
EXAMPLE
###
xx <- data.frame(aa =1:24,
b = matrix(sample(c(1,2,3,4,5,6), 72, replace = TRUE
6 matches
Mail list logo