Quantcast

Plot with Group # as pch

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Plot with Group # as pch

Kevin Burnham
Hi All,
I am trying to plot per cent correct scores (column name =PerCorr) for each
of about 40 subjects.  I would like the character representing each score to
be a number between 0 and 4 depending on the subject's group (from the
column Subject.Group).
Also, I would ideally be able to order the data by Subject.Group first so
that all of group 0 is to the far left of the graph and all of group 4 to
the far right.
Thanks,
Kevin

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Plot with Group # as pch

David Winsemius

On Sep 13, 2010, at 5:48 PM, Kevin Burnham wrote:

> Hi All,
> I am trying to plot per cent correct scores (column name =PerCorr)  
> for each
> of about 40 subjects.  I would like the character representing each  
> score to
> be a number between 0 and 4 depending on the subject's group (from the
> column Subject.Group).

You can use text(x,y,   labels=    ) for the plotting ... once you  
have a working example that is.

> Also, I would ideally be able to order the data by Subject.Group  
> first so
> that all of group 0 is to the far left of the graph and all of group  
> 4 to
> the far right.
> Thanks,
> Kevin


David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Plot with Group # as pch

Kevin Burnham
The line I have now is this:

plot(alldata$haa_Haa, pch=alldata$Subject.Group)

This more or less gives me what I want, but instead of using the actual
group number as the plotting point it converts it to the pch character
corresponding to that number.  Is there a way that the above line could be
modified so that it would use the group 3 itself, rather than the
corresponding charecter?

thanks again,
k

On Mon, Sep 13, 2010 at 5:00 PM, David Winsemius <[hidden email]>wrote:

>
> On Sep 13, 2010, at 5:48 PM, Kevin Burnham wrote:
>
>  Hi All,
>> I am trying to plot per cent correct scores (column name =PerCorr) for
>> each
>> of about 40 subjects.  I would like the character representing each score
>> to
>> be a number between 0 and 4 depending on the subject's group (from the
>> column Subject.Group).
>>
>
> You can use text(x,y,   labels=    ) for the plotting ... once you have a
> working example that is.
>
>
>  Also, I would ideally be able to order the data by Subject.Group first so
>> that all of group 0 is to the far left of the graph and all of group 4 to
>> the far right.
>> Thanks,
>> Kevin
>>
>
>
> David Winsemius, MD
> West Hartford, CT
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Plot with Group # as pch

Peter Ehlers
On 2010-09-13 16:11, Kevin Burnham wrote:

> The line I have now is this:
>
> plot(alldata$haa_Haa, pch=alldata$Subject.Group)
>
> This more or less gives me what I want, but instead of using the actual
> group number as the plotting point it converts it to the pch character
> corresponding to that number.  Is there a way that the above line could be
> modified so that it would use the group 3 itself, rather than the
> corresponding charecter?
>

Wrap your pch values in as.character().

   -Peter Ehlers

> thanks again,
> k
>
> On Mon, Sep 13, 2010 at 5:00 PM, David Winsemius<[hidden email]>wrote:
>
>>
>> On Sep 13, 2010, at 5:48 PM, Kevin Burnham wrote:
>>
>>   Hi All,
>>> I am trying to plot per cent correct scores (column name =PerCorr) for
>>> each
>>> of about 40 subjects.  I would like the character representing each score
>>> to
>>> be a number between 0 and 4 depending on the subject's group (from the
>>> column Subject.Group).
>>>
>>
>> You can use text(x,y,   labels=    ) for the plotting ... once you have a
>> working example that is.
>>
>>
>>   Also, I would ideally be able to order the data by Subject.Group first so
>>> that all of group 0 is to the far left of the graph and all of group 4 to
>>> the far right.
>>> Thanks,
>>> Kevin
>>>
>>
>>
>> David Winsemius, MD
>> West Hartford, CT
>>
>>

______________________________________________
[hidden email] 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.
Loading...