Social Media Research

02 R Data Analysis


Question

Give the mean value of 1,2,3,4, NA.


Answer

mean(c(1,2,3,4, NA), na.rm=TRUE)

This function [mean (x, na.rm=TRUE)] removes all missing values. If you would just enter mean(c(1,2,3,4,NA)) the output would be NA.




Comments