I've been trying to calculate the mean of a column in a data.frame inside a function which I pass teh data.frame and the name of the column to calculate but I'm not able to do so
This is an example of the data
aleatorio<-rnorm(1:52)
cod_prov<-c(1:52)
datosprov<-cbind(cod_prov, aleatorio)
rm(aleatorio,cod_prov)
This is the function
prueba<-function(bbdd,varmap){
forMap<-noquote(paste0(substitute(bbdd),"$",substitute(varmap)))
mean(forMap)
}
prueba(datosprov,"positivo")