hola, aqui una forma de hacerlo usando stack() y data.table()


library(data.table)
d <- read.csv("/home/neo/Desktop/beta.csv", header=TRUE, sep="\t")
d
d <- stack(d)
d <- as.data.table(d)
d[, mean(values), by=ind]


saludos,

Eric.





On 02/16/2017 01:11 PM, jbetanco...@iscmc.cmw.sld.cu wrote:

Estimados

Quisiera calcular las medias de cada semana de una sola vez con un script.
Apreciaría su ayuda

sem01   sem02   sem03   sem04
43      46      49      42
67      57      74      87
33      39      38      34
82      55      59      44
33      39      38      34

saludos
José



--
Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

_______________________________________________
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


--
Forest Engineer
Master in Environmental and Natural Resource Economics
Master in Sciences of Natural Resources
Ph.D. student in Sciences of Natural Resources at La Frontera University
Member in AguaDeTemu2030, citizen movement for Temuco with green city standards for living

Nota: Las tildes se han omitido para asegurar compatibilidad con algunos lectores de correo.

_______________________________________________
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es

Responder a