Re: [R] a replace for subset

2016-04-16 Thread Jeff Newmiller
On Sat, 16 Apr 2016, ch.elahe via R-help wrote: -Thank you James, well the problem of my type of data is that there can be many possible subsets and therefore plots, and I want to automatically generate them, and facet_wrap does not give me all the possible cases Not true. It may get crampe

Re: [R] a replace for subset

2016-04-16 Thread Jeff Newmiller
Use the split function to automatically create a list of pre-subsetted data frames, and then generate your output however you wish to. For example (using Jim Lemon's sample data generator): library(ggplot2) mydata <- data.frame( RE = sample( 5:50, 100, TRUE) , LU = sample(

Re: [R] a replace for subset

2016-04-16 Thread ch.elahe via R-help
-Thank you James, well the problem of my type of data is that there can be many possible subsets and therefore plots, and I want to automatically generate them, and facet_wrap does not give me all the possible cases On Saturday, April 16, 2016 6:01 AM, James C. Whanger wrote: Would facet

Re: [R] a replace for subset

2016-04-16 Thread James C. Whanger
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 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

[R] a replace for subset

2016-04-16 Thread ch.elahe via R-help
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: Fa

Re: [R] a replace for subset

2016-04-15 Thread Jim Lemon
Hi Elahe, When you want to include a usable toy data frame, it's better to use something like: dput(mydata[1:100]) So if we have a data frame like this: mydata<-data.frame(RE=sample(5:50,100,TRUE), LU=sample(1500:4500,100), COUNTRY=factor(sample(c("DE","FR","JP","AU"),100,TRUE)), Light=fac

Re: [R] a replace for subset

2016-04-14 Thread Bert Gunter
A mess! Please follow the posting guide: post in *plain text*, not HTML. Cheers. Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Apr 14, 2016 at 1:1

[R] a replace for subset

2016-04-14 Thread ch.elahe via R-help
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/