I think the easiest way is using na.omit function which omits pairs of data

Look at the following example:

> x <- c(0,1,2,3,4,5)
> y <- c(NA,2, 3, 5, NA, 6)
> data.1 <- data.frame(x,y)
> data.1
  x  y
1 0 NA
2 1  2
3 2  3
4 3  5
5 4 NA
6 5  6
> new.data <- na.omit(data.1)
> new.data
  x y
2 1 2
3 2 3
4 3 5
6 5 6
>

--
Jose A. Hernandez
Ph.D. Candidate
Precision Agriculture Center

Department of Soil, Water, and Climate
University of Minnesota
1991 Upper Buford Circle
St. Paul, MN 55108

Ph. (612) 625-0445, Fax. (612) 625-2208

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to