Re: [R] Removing NA in ggplot

2010-11-06 Thread Joshua Wiley
On Sat, Nov 6, 2010 at 4:43 PM, Ottar Kvindesland wrote: > OK, any reason why ggplot2 does not allow filtering of NA? It is not so much that ggplot2 does not allow the filtering of NA values, it is that you need to use data from the dataset you specified. By subsetting in aes() rather than in da

Re: [R] Removing NA in ggplot

2010-11-06 Thread Ottar Kvindesland
OK, any reason why ggplot2 does not allow filtering of NA? ottar On 6 November 2010 15:23, Jeff Newmiller wrote: > Create a subset of your data that excludes the NAs before you feed it to > ggplot. > > "Ottar Kvindesland" wrote: > > >Hi list, > > > >I just got stuck with this one: > > > >In D

Re: [R] Removing NA in ggplot

2010-11-06 Thread Jeff Newmiller
Create a subset of your data that excludes the NAs before you feed it to ggplot. "Ottar Kvindesland" wrote: >Hi list, > >I just got stuck with this one: > >In Data I have the sets age (numbers 1 to 99 and NA) and gender (M, F >and >NA). Then getting some nice plots using > >ggplot(data, aes(age[

[R] Removing NA in ggplot

2010-11-06 Thread Ottar Kvindesland
Hi list, I just got stuck with this one: In Data I have the sets age (numbers 1 to 99 and NA) and gender (M, F and NA). Then getting some nice plots using ggplot(data, aes(age[na.exclude(gender)])) + geom_histogram( binwidth = 3, aes(y = ..density.. ), fill = "lightblue" ) + facet_grid( gende