[R] Mirror Image on Biplot Graphic

Mark Difford mark_difford at yahoo.co.uk
Tue Oct 7 15:34:07 CEST 2008


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 at 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.



More information about the R-help mailing list