## Identify rows with NAs
xx <- c(15, 39, 18, 16, NA, 53)
where.na(xx)
## To use where.na to remove NAs, method 1
xx
temp <- where.na(xx)
temp
xxx <- xx[-temp]
xxx
## To use where.na to remove NAs, method 2
xx
xxx <- xx[-where.na(xx)]
xxx
## Clean-up
rm(xx)
rm(xxx)
rm(temp)
Run the code above in your browser using DataLab