Hey, Does anyone know how to remove labels from a biplot? I want to input them manually as they are currently overlapping. Thanks -- Le gach dea ghui, Shane [[alternative HTML version deleted]]
The xlabs= (rows) and ylabs= (columns) arguments handle the labels, but they do not recycle so you need to specify values for each row and each column:> set.seed(42) > x <- matrix(rnorm(500), 50, 10) > biplot(prcomp(x), xlabs=rep("", 50), ylabs=rep("", 10))------------------------------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -----Original Message----- From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Shane Carey Sent: Wednesday, June 22, 2016 7:39 AM To: r-help at r-project.org Subject: [R] biplot Hey, Does anyone know how to remove labels from a biplot? I want to input them manually as they are currently overlapping. Thanks -- Le gach dea ghui, Shane [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
I should have mentioned that the points are invisible without the labels and there is no way to use plot symbols. Something like this is probably what you wanted.> biplot(prcomp(x), xlabs=rep("*", 50), ylabs=rep("", 10))Gives you the arrows and asterisks for the points. But labeling them is not easy since the coordinates are based on the columns:> par("usr")[1] -6.705729 7.179791 -6.705729 7.179791 David C -----Original Message----- From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of David L Carlson Sent: Wednesday, June 22, 2016 10:44 AM To: Shane Carey; r-help at r-project.org Subject: Re: [R] biplot The xlabs= (rows) and ylabs= (columns) arguments handle the labels, but they do not recycle so you need to specify values for each row and each column:> set.seed(42) > x <- matrix(rnorm(500), 50, 10) > biplot(prcomp(x), xlabs=rep("", 50), ylabs=rep("", 10))------------------------------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -----Original Message----- From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Shane Carey Sent: Wednesday, June 22, 2016 7:39 AM To: r-help at r-project.org Subject: [R] biplot Hey, Does anyone know how to remove labels from a biplot? I want to input them manually as they are currently overlapping. Thanks -- Le gach dea ghui, Shane [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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. ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
On 6/22/2016 8:39 AM, Shane Carey wrote:> Hey, > > Does anyone know how to remove labels from a biplot? I want to input them > manually as they are currently overlapping. >Rather than doing them manually, you might have better luck with ggbiplot, and the ggrepel package designed to 'repel' point labels so they don't overlap. install_github("vqv/ggbiplot") https://cran.r-project.org/web/packages/ggrepel/vignettes/ggrepel.html -Michael
> Rather than doing them manually, > you might have better luck with ggbiplot, and the ggrepel package designed to > 'repel' point labels so they don't overlap.For base graphics, 'thigmophobe.lables' in the plotrix package also works to avoid label overlap. Steve E ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}