I am new to R, and I don\'t understand yet completely the logic of its calculations...
I cannot overcome my problem with the help from previous posts either.
You could use colMeans
op <- options(scipen= 100, digits=2)
colMeans(mldata[,3:11], na.rm=TRUE)
# CHINN DEBT ERA INFL MONEY
# -0.27 115.25 0.20 33.66 74.66
#OPENNESS RESERVES RGDP RSVS
# 92.06 18809465124.14 136.56 18.81
options(op)
or summarise_each from dplyr
library(dplyr)
mldata %>%
summarise_each(funs(round(mean(., na.rm=TRUE),2)), CHINN:RSVS)
# CHINN DEBT ERA INFL MONEY OPENNESS RESERVES RGDP RSVS
#1 -0.27 115.25 0.2 33.66 74.66 92.06 18809465124 136.56 18.81