[R] dotchart for matrix data

e-letter inpost at gmail.com
Sat Dec 18 19:27:00 CET 2010


On 18/12/2010, Peter Ehlers <ehlers at ucalgary.ca> wrote:
> On 2010-12-18 07:50, e-letter wrote:
>>> Ben Bolker
>>> Sat, 18 Dec 2010 07:07:24 -0800
>
> [... snip ...]
>
>> I am trying to create a chart like this
>> (http://www.b-eye-network.com/images/content/Fig4_3.jpg); so this is
>> not possible using R?
>
> That looks an awful lot like what lattice's dotplot would
> produce. So: have you tried dotplot() as Ben has suggested?
>

For the benefit of other novices, this is what I did (gnu/linux):

sign-in to a command terminal as root
start R
install.packages("reshape2")

In another terminal as normal user

require(reshape2)
mdot<-melt(testdot)
dotplot(value~category,groups=variable,data=mdot)

The resultant graph shows the categories on the abscissa and there
does not seem to be a way of selecting two columns from the original
matrix. It is not like the graph cited in the hyperlink quoted above,
but at least I have successfully followed instructions!

I changed the axes with the command:

dotplot(category~value,groups=variable,data=mdot)

I believe there is a command to select only certain rows of data which
I think will achieve the desired graph, if unable I'll ask again, so
thank you all.



More information about the R-help mailing list