Re: [R] Calculating mean, median, minimum, and maximum

2014-12-19 Thread mtrang
You can use the apply function which "applies" a function of your choice, and MARGIN = 2 means you want to do it columnwise: > apply(X = df, MARGIN=2, FUN = mean, na.rm = TRUE) Latitude Longitude January February March April May June 26.9380 -109.8125 159.8454 156.4489

Re: [R] Calculating mean, median, minimum, and maximum

2014-12-18 Thread mtrang
Can you show what the first few rows of your table look like so that we understand the structure? -- View this message in context: http://r.789695.n4.nabble.com/Calculating-mean-median-minimum-and-maximum-tp4700862p4700919.html Sent from the R help mailing list archive at Nabble.com. _