x <- c(1,2,NA,3)
mean(x)
mean(x, na.rm=TRUE)

#check for missing values
#Testing for Missing Values
is.na(x) # returns TRUE of x is missing
y <- c(1,2,3,NA)
is.na(y) # returns a vector (F F F T)

table(is.na(x))

sum(is.na(x))

sum(!is.na(x))
v <- c(NA, NA, 0.5, 1, 12, 15, 3)
summary(v)
v <- c(-1, "-nodata-", 0.5, 1, 12, 15, 3)
table(v)

summary(na.omit(x))
