Re: [R] selecting only specific rows in R

From: stephen sefick <ssefick_at_gmail.com>
Date: Sat, 05 Jun 2010 12:00:37 -0500

Reproducible dummy example, as to the posting guide. look at uniqueyou  want to subset the data frame on all of the non-unique entries in the species column...

x[x!=unique(x[,"species"]),]

Something like that, maybe. If I had some data then I could probably figure it out. Use dput() or fake data to make a cut and paste-able example.
HTH, Stephen

On Sat, Jun 5, 2010 at 10:00 AM, Adrienne Keller <adrienne.keller_at_umontana.edu> wrote:
> Hi, I have a data frame with columns as follows: tree species (independent
> variable) and several dependent variables (e.g. carbon, nitrogen,
> phosphorus). Each row represents one tree sample. Some tree samples are
> unique species in the data frame while other species were replicated (i.e.
> rows 1,2,3 may be identical for the "tree species" column but have different
> values for the other dependent variable columns). I want to create a new
> data frame that selects only the tree species that have replicates. In other
> words, I want to select all rows that have at least one replicate in the
> column "tree species".
>
> Ideas on how to write such a function?
>
> Thanks,
>
> Adrienne Keller
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> 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.
>

-- 
Stephen Sefick
____________________________________
| Auburn University                                   |
| Department of Biological Sciences           |
| 331 Funchess Hall                                  |
| Auburn, Alabama                                   |
| 36849                                                    |
|___________________________________|
| sas0025_at_auburn.edu                             |
| http://www.auburn.edu/~sas0025             |
|___________________________________|

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

								-K. Mullis

______________________________________________
R-help_at_r-project.org mailing list
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.
Received on Sat 05 Jun 2010 - 17:04:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 Jun 2010 - 21:00:44 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive