Hello,

Like Ivan said, you should give us a data example, the best way is to do it is to paste the output of ?dput in a post. If your data frame is named 'dat' use the following.

dput(head(dat, 50))  # paste the output of this in a post

As for the question, here is an example using ?aggregate, with fake data.


dat <- data.frame(X = rnorm(100), A = sample(8, 100, TRUE))

aggregate(X ~ A, data = dat, FUN = mean)


Hope this helps,

Rui Barradas

Em 03-06-2013 10:15, Laura Thomas escreveu:
Hi All,

Sorry about this quite basic, but I am very new to R.

I have a data file which has a dependent variable (reaction time) and a couple 
of independent variables, one of which is coded 1-8; I want to calculate the 
reaction time for each of the 8 codes of the independent variable.

Thanks for any help,

Laura

______________________________________________
R-help@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.


______________________________________________
R-help@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.

Reply via email to