missing values in each column r code example
Example 1: r count number of na
sum(is.na(df))
Example 2: percent of missing data in df r
# Apply on dataframe with missing values
sum(is.na(x))/prod(dim(x))
sum(is.na(df))
# Apply on dataframe with missing values
sum(is.na(x))/prod(dim(x))