Message-ID: <CAGG=QuG7bnsZF-aDfdei7Pc2VACZQANR3GFkMk+Y4s3S4cvNtQ@mail.gmail.com>
Date: 2016-04-16T13:01:46Z
From: James C. Whanger
Subject: a replace for subset
In-Reply-To: <1254096290.2451184.1460810714645.JavaMail.yahoo@mail.yahoo.com>
Would facet_wrap or facet_grid give you what you want?
On Sat, Apr 16, 2016 at 8:45 AM, ch.elahe via R-help <r-help at r-project.org>
wrote:
> Hi,
> I have a data set (mydata), which a part of this is like the following:
>
>
> 'data.frame': 36190 obs. of 16 variables:
> $ RE : int 38 41 11 67 30 18 38 41 41 30 ...
> $ LU : int 4200 3330 530 4500 3000 1790 4700 3400
> 3640 4000 ...
> $ COUNTRY : Factor w/ 4 levels "DE","FR","JP", "FR"?
> $Light : Factor w/2 levels "ON","OFF","ON", ?.
> $OR : Factor w/2 levels "S","T","S",?.
> $PAT : Factor w/3 levels "low", "high", "middle",?.
>
>
> Now I want to plot RE vs LU with ggplot2 for all the possible cases, I
> know how to do subsetting for the data but I want to know is there any
> shorter way to do that? For example I want to have a plot for RE vs LU for
> (COUNTRY= FR, Light=off, OR=S, PAT=low) and one for (COUNTRY= FR, Light=on,
> OR=S, PAT=high) and ?., as you see doing subset is time consuming, is there
> any other way?
> Thank you for any help.
> Elahe
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
--
*James C. Whanger*
[[alternative HTML version deleted]]