m: Dennis Murphy [mailto:djmu...@gmail.com]
> Sent: Tuesday, January 04, 2011 9:07 PM
> To: SNV Krishna
> Cc: r-help@r-project.org
> Subject: Re: [R] how to subset unique factor combinations from a data
frame.
>
>
> Hi:
>
> Did you try something like
>
> summdf <-
Hi Dennis,
It worked! this is what I am looking for. Many thanks.
Rgds,
SNVK
_
From: Dennis Murphy [mailto:djmu...@gmail.com]
Sent: Tuesday, January 04, 2011 9:07 PM
To: SNV Krishna
Cc: r-help@r-project.org
Subject: Re: [R] how to subset unique factor combinations from a data
Hi:
Did you try something like
summdf <- as.data.frame(with(df, table(Commodity, Attribute,
Unit)))
?
The rows of the table should represent the unique combinations of the three
variables
Here's a simple toy example to illustrate:
> x <- sample(LETTERS[1:6], 1000, replace = TRUE)
> xx <- sa
Hi
r-help-boun...@r-project.org napsal dne 04.01.2011 11:19:02:
> Hi,
>
> Sorry that my example is not clear. I will give an example of what each
> variable holds. I hope this clearly explains the case.
>
> Names of the dataframe (df) and description
>
> Year :- Year is calendar year, from 198
Hi,
Sorry that my example is not clear. I will give an example of what each
variable holds. I hope this clearly explains the case.
Names of the dataframe (df) and description
Year :- Year is calendar year, from 1980 to 2010
Country :- is the country name, total no. (levels) of countries is ~ 19
5 matches
Mail list logo