[R] Question:How to get rid of missing values

Jim Lemon jim at bitwrit.com.au
Wed Feb 24 22:49:42 CET 2010


On 02/25/2010 05:06 AM, Lu Wang wrote:
> ...
> The
> problem is the na.exclude function does not work here. Is it the reason
> that my missing values are not 'NA's but blank? How can I get the pie
> chart without those missing values?
>

Hi Lu,
Your problem is most easily solved when reading in the data.

# this reads the blank fields as <NA>
level<-read.table("lu_wang.dat",header=TRUE,fill=TRUE,na.strings="")
pie(table(level$level))

Jim



More information about the R-help mailing list