[R] Mirror Image on Biplot Graphic

Rodrigo Aluizio r.aluizio at gmail.com
Tue Oct 7 16:25:19 CEST 2008


> Thanks a lot for your help (again) Mark.
> I adapted your suggestion to my analysis.
> But I'm getting and error when trying to apply the new values.
> The error is:
>
> Erro em scores(CAPpotiFTI)$species[, 2] <- scores(CAPpotiFTI)$species[,  :
>  não foi posssível encontrar a função "scores<-"
>
> Translating:
> Error at scores(CAPpotiFTI)$species[, 2] <- scores(CAPpotiFTI)$species[, 
> :
>  it's not possible to find the function "scores<-"
>
> Bellow how I applied the suggestion:
> CAPpotiFTI<-CAPpotiFT
> scores(CAPpotiFTI)$species[,2]<-scores(CAPpotiFTI)$species[,2]*-1
> scores(CAPpotiFTI)$sites[,2]<-scores(CAPpotiFTI)$sites[,2]*-1
>
> Any ideas? I'm trying similar things but without success.
>
> --------------------------------------------------
> From: "Mark Difford" <mark_difford em yahoo.co.uk>
> Sent: Tuesday, October 07, 2008 10:34 AM
> To: <r-help em r-project.org>
> Subject: Re: [R] Mirror Image on Biplot Graphic
>
>>
>> Hi Rodrigo,
>>
>> Sorry, that will not return a result (I use several different ordination
>> packages, in most of which this is possible). What you need to do with 
>> vegan
>> is the following:
>>
>> scores(mynew.cca)$species[, 2] <- scores(mynew.cca)$species[, 2] * -1
>>
>> You will be able to do the rest.
>>
>> Regards, Mark.
>>
>>
>> Mark Difford wrote:
>>>
>>> Hi Rodrigo,
>>>
>>>>> I need to rotate on y axis the lines and symbols of constrained and
>>>>> sites representation.
>>>
>>> Easiest is to multiply the axis you want to invert by -1. Something like
>>> the following, where my.cca is the orginal object and yax = obj[, 2] 
>>> (xax
>>> being obj[, 1]). Obviously, copying isn't necessary.
>>>
>>> mynew.cca <- my.cca
>>> mynew.cca$scores$species[, 2] <- my.cca$scores$species[, 2] * -1
>>> mynew.cca$scores$sites[, 2] <- my.cca$scores$sites[, 2] * -1
>>> mynew.cca$scores$centroids[, 2] <- my.cca$scores$centroids[, 2] * -1
>>>
>>> Regards, Mark.
>>>
>>>
>>> Rodrigo Aluizio wrote:
>>>>
>>>> He everybody,
>>>> Well I have a biplot CCA-like origined from plot.cca (vegan package). I
>>>> need to rotate on y axis the lines and symbols of constrained and sites
>>>> representation. If I do that on an image editor, I rotate everything,
>>>> including titles, axes labels and positions. I just need to rotate the
>>>> inner par and keep the variables names (constrained) and symbols in the
>>>> new positions but with the right direction.
>>>> So, is there on R a way to do that while creating the image?
>>>> Here is the code that generate the graphic.
>>>>
>>>> plot.cca(CAPpotiFT,type='none',display=c('bp','sites'),main='Total 
>>>> Fauna
>>>> Sites x Environment')
>>>> text.cca(CAPpotiFT,dis='cn',col='black',cex=0.6,lwd=0.5,lty='dotted')
>>>> points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='1',],pch=21)
>>>> points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='2',],pch=20)
>>>> points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='3',],pch=22,bg='gray')
>>>> points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='4',],pch=24)
>>>> points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='5',],pch=24,bg='black')
>>>> points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='6',],pch=25,bg='gray')
>>>>
>>>> Thanks in advice.
>>>> ___________________________________
>>>> MSc. Rodrigo Aluizio
>>>> Centro de Estudos do Mar/UFPR
>>>> Laboratório de Micropaleontologia
>>>>
>>>> [[alternative HTML version deleted]]
>>>>
>>>>
>>>> ______________________________________________
>>>> R-help em r-project.org 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.
>>>>
>>>>
>>>
>>>
>>
>> -- 
>> View this message in context: 
>> http://www.nabble.com/Mirror-Image-on-Biplot-Graphic-tp19857549p19858268.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> R-help em r-project.org 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.
>>



More information about the R-help mailing list