Message-ID: <9c8be1ab-a3cc-447e-b596-4320f5abcb2a@googlegroups.com>
Date: 2012-11-29T10:14:50Z
From: sudhi rao
Subject: remove NA or 0 values
In-Reply-To: <CAEW+BD+XAeDiUfxx6-wDyB5wmMQSyZRfuSsk-JU_=aVx8Eb3-g@mail.gmail.com>
df <- df[-which(is.na(df$Field)), ] - removing rows with NULL fields
df <- df[-which(df$Field == "" ), ] - removing rows with empty fields
On Wednesday, November 28, 2012 2:23:00 PM UTC+5:30, catalin roibu wrote:
>
> Dear R users,
> I want to remove zero's or NA values after this model.
>
> year value1 value2
> 1854 0 12
> 1855 0 13
> 1866 12 16
> 1877 11 24
>
> year value1 value2
> 1 12 12
> 2 11 13
> 3 16
> 4 24
>
> Thank you!
>
>
> --
> ---
> Catalin-Constantin ROIBU
> Forestry engineer, PhD
> Forestry Faculty of Suceava
> Str. Universitatii no. 13, Suceava, 720229, Romania
> office phone +4 0230 52 29 78, ext. 531
> mobile phone +4 0745 53 18 01
> +4 0766 71 76 58
> FAX: +4 0230 52 16 64
> silvic.usv.ro
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-h... at r-project.org <javascript:> mailing list
> 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.
>