Mean added

add the mean method in R and fix some docs