powered by
mn(), md() and sm() calculate the mean, median or sum of values in a vector, but have set argument na.rm to TRUE by default.
mn()
md()
sm()
na.rm
TRUE
mn(x, na.rm = TRUE)sm(x, na.rm = TRUE)md(x, na.rm = TRUE)
sm(x, na.rm = TRUE)
md(x, na.rm = TRUE)
A vector.
Logical, whether to remove NA values from x before computing mean, median or sum.
x
The mean, median or sum of x.
# NOT RUN { data(efc) md(efc$neg_c_7) mn(efc$neg_c_7) mean(efc$neg_c_7) sm(efc$neg_c_7 > 15) # }
Run the code above in your browser using DataLab