get percent of matrix is.na r code example
Example 1: percent of missing data in df r
# Apply on dataframe with missing values
sum(is.na(x))/prod(dim(x))
Example 2: percentage rows are na
mean(is.na(x))
# Apply on dataframe with missing values
sum(is.na(x))/prod(dim(x))
mean(is.na(x))