Skip to content
Back to formatted view

Raw Message

Message-ID: <49CA02DB.3080704@uni-koeln.de>
Date: 2009-03-25T10:09:31Z
From: Bernd Weiss
Subject: [ggplot2] Densityplot, grouping and NAs
In-Reply-To: <2E9C414912813E4EB981326983E0A1040642F554@inboexch.inbo.be>

ONKELINX, Thierry schrieb:
> Dear Bernd,
> 
> Omitting the NA values from the dataset will work.
> 
> ggplot(aes(x = x, color = g), data = na.omit(mydf)) + geom_density() 

Dear Thierry,

thanks for your reply! Of course, regarding my little toy example 
na.omit() perfectly works. However, my real data set consists of 
hundreds of variables. So, one has to write

... data = na.omit(myHugeDataset[,c("var1","var99","var208")]) ...

Bernd