Kare Edvardsen wrote:

> Hi all!
> 
> I've got a datstructure like this:
> 
> subject  week  value
> 
> 1     1       4
> 2     1       8
> 3     1       3
> 4     1       5
> 
> 1     2       5
> 2     2       6
> 3     2       2
> 4     2       6
> 
> 1     3       3
> 2     3       7
> 3     3       3
> 4     3       7
> 
> I'd like to plot the mean of 'value' against week. Is there a direct way 
> of doing this or do I have to make a new structure with the calculated 
> values and then plot it?

For your data.frame X, you want, e.g.:

   A <- aggregate(X, list(X$week), mean)
   plot(A$week, A$value)

Uwe Ligges

> All the best!
>

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to