Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

Re: [R] Subset

Petr Klasterecky

2007-03-23

Replies:

You want to obtain a subset of your data, so what about to use subset()...??
You didn't even consider doing some basic search for the solution as the
posting guide asks you...

Petr

Sergio Della Franca napsal(a):
> Dear R-Helpers,
>
> I have this dataset:
>
>   YEAR   PRODUCTS cluster
>   1       10       2
>   2       42       3
>   3       25       2
>   4       42       3
>   5       40       3
>   6       45       1
>   7       44       1
>   8       47       1
>   9       42       1
>
>
> I want to create a subset (when cluster=1),
>
>   YEAR   PRODUCTS cluster
>   6       45       1
>   7       44       1
>   8       47       1
>   9       42       1
>
>
> How can i perform this?
>
>
> Thank you in advance.
>
>
> Sergio Della Franca
>
>  [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@(protected)
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--
Petr Klasterecky
Dept. of Probability and Statistics
Charles University in Prague
Czech Republic

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
©2008 r-help.com - Jax Systems, LLC, U.S.A.