Replacing all NAs with mean values of a given row
row_mean_na(data, func, observations, na.rm = FALSE, exc)
data | is the data you for which the mean is needed |
---|---|
func | describes the function to use. Currently only supports the mean(others may work with some inaccuracies) |
observations | takes on column names for which manipulations are required |
na.rm | Logical. Should NAs be removed from analysis? |
exc | the column to exclude from analysis. Useful for removing factor columns |
Returns a data.frame object showing columns with NAs and their replacement if na.rm=T