On Thu, Feb 24, 2011 at 1:21 PM, Art <john.arthu...@gmail.com> wrote:
> Is it possible to plot the row names along the axis in the following example
> data.frame?
> DM DI DL VM VI VL
> r1 2.7 6.8 6.5 2.5 7.3 5.0
> r2 2.7 10.8 10.5 2.7 8.5 10.2
> r2.5 9.5 16.5 9.7 7.3 13.2 10.7
> r3 13.2 42.7 20.7 9.2 26.0 20.0
> r4 17.7 49.2 27.5 6.3 35.7 26.5
> i1 36.2 40.3 30.2 10.0 37.0 19.5
> i2 52.0 34.2 20.3 34.0 36.0 25.5
> i3 45.0 58.0 25.3 29.3 49.2 32.7
> c1 32.3 44.3 16.2 23.5 42.7 22.3
> For example:
> ggplot(jenn, aes(?, DL)) + geom_point() ## What do you indicate for the x
> variable
Just enter the values you want on the x-axis:
ggplot(jenn, aes(rownames(jenn), DL)) + geom_point()
>
> A second statistical question related to this data.frame.
> What is the easiest way to code the mean of the row (i.e. mean across
> columns for row r2)?
rowMeans(jenn)
Sometimes
jenn$row.mean <- rowMeans(jenn)
is helpful. Or, if you really only want the value of row r2, take your pick of
rowMeans(jenn)["r2"]
mean(jenn["r2" ,])
Best,
Ista
> Is the data.frame the most efficient way to represent the data in order to
> calculate these values?
> Thanks,
> Art
>
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
--
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org
Thanks,Art--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
Thanks,Art--
Thanks,Art--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: