Skip to content
Prev 305058 / 398506 Next

Producing a table with mean values

HI John,

I got it.? Please disregard my previous email.
I guess the code should be:

tabx <-? ddply(meltx, .(Seamount, variable),? summarize, mean = mean(value), sd = sd(value))


A.K.

----- Original Message -----
From: John Kane <jrkrideau at inbox.com>
To: Tinus Sonnekus <tsonnekus at gmail.com>; r-help at r-project.org
Cc: 
Sent: Saturday, September 8, 2012 1:19 PM
Subject: Re: [R] Producing a table with mean values

x? <-?  " Seamount? ?  Pico? ? Nano?  Micro? ? Total_Ch
Off_Mount1 0.0691 0.24200 0.00100? 0.31210
Off_Mount1 0.0938 0.00521 0.02060? 0.11961
Off_Mount1 0.1130 0.20000 0.06620? 0.37920
Off_Mount1 0.0864 0.15900 0.22300? 0.46840
Off_Mount1 0.0262 0.04570 0.00261? 0.07451
Off_Mount2 0.0314 0.17400 0.12800? 0.33340
Off_Mount2 0.0314 0.17400 0.12800? 0.23340
Off_Mount2 0.0414 0.17400 0.02800? 0.23340"

xx <- read.table(textConnection(x), header=TRUE, as.is=TRUE)

library(reshape)
meltx? <-? melt(xx)

tabx <-? ddply(nn, .(Seamount, variable),? summarize, mean = mean(value), sd = sd(value))

tabx

John Kane
Kingston ON Canada
____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM?, MSN? Messenger, Yahoo!? Messenger, ICQ?, Google Talk? and most webmails

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.