| naPercentage | R Documentation |
Calculates the percentage of NA values within each column or row of a data structure.
naPercentage(x, by.row = FALSE, row.range = 1:nrow(x), col.range = 1:ncol(x))
x |
A matrix-like R object with two dimensions to get the missing data percentage for. |
by.row |
A logical value indicating whether to calculate the missing data percentage by row. |
row.range |
A numeric vector containing the row numbers to be included in the missing percentage calculation. |
col.range |
A numeric vector containing the column numbers to be included in the missing percentage calculation. |
Returns a data frame with the columns sharing the same column or row names as the passed data and a single row containing the percentage of elements within a row or column with NA values.
# Default by column na_pct <- naPercentage(data) # By row, excluding first column na_pct_byrow <- naPercentage(data_byrow, by.row = TRUE, col.range = 2:ncol(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.