[Solved] Observation deleted due to missingness in R

I am busy with a regression model in R and i have about 16 000 observations. One of these observations causes me to get the following error message,

(1 observation deleted due to missingness)

Is there a way in R so that i can identify this one observation?

Solution #1:

If your data is in a data.frame x, and each row corresponds to an observation, then the way to go about this is to identify complete cases via complete.cases(x). Conversely, to find missing values in an observation, do ! complete.cases(x). To find out which observation contains missing values, do

which(! complete.cases(x))
Respondent: Konrad Rudolph

Solution #2:

There is MWE as well as a solution in this web page : https://stat.ethz.ch/pipermail/r-help/2010-February/227526.html

which(is.na(variable)) as commented by @PeterDee seems to be indeed the solution

Respondent: ClementWalter

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Leave a Reply

Your email address will not be published.