[R] dotchart for matrix data

e-letter inpost at gmail.com
Wed Dec 22 11:59:55 CET 2010


On 20/12/2010, e-letter <inpost at gmail.com> wrote:
> On 18/12/2010, e-letter <inpost at gmail.com> wrote:
>> 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?
>>>
>>
>

A csv file is imported:

> testdot
  category values
1        a     10
2        b     44
3        c     51
4        d     65
5        a     27
6        b     64
7        c     71
8        d     49

A dotplot is produced with the command:

dotplot(category~values,data=testdot)

The csv file is adjusted to move the values of 'a':

> testdot
  category values
1        b     44
2        c     51
3        d     65
4        a     10
5        b     64
6        c     71
7        d     49
8        a     27

Why  does the order of the categories not change from d,c,b,a to
a,d,c,b (descending from top)?



More information about the R-help mailing list