Questions tagged [autoplot]
30 questions
2
votes
0 answers
How to I change the colour fill on stat_ellipsis(geom='polygon') to match the scale_color_brewer palette colours for PCA plot?
I am using the autoplot() function to add ellipsis and polygons to my PCA plot in R, my colour palette for the points is the color.brewer 'Set2' palette. When I am filling my ellipsis with geom='polygon', I want the polygon fill colour to be the…

JamesLG
- 21
- 1
2
votes
1 answer
Plotting only selected loadings in R
I have a PCA with more than 150 variables, when plotting the loadings the PCA become obviously a mess. Is there a way to plot only selected loadings?
As an example: with iris I end up with 4 loadings, how can I only plot 1 (let say…

Werc
- 23
- 3
2
votes
1 answer
Error in `levels<-`(`*tmp*`, value = as.character(levels)) : factor level [3] is duplicated
I'm trying to plot faceted survival curves with autoplot but the combination of covariates and facetting them duplicates levels within the factors
library(survival)
library(ggfortify)
fit <- survfit( Surv(time, status) ~ inst + sex,
…

brucezepplin
- 9,202
- 26
- 76
- 129
1
vote
1 answer
Labelling points in an autoplot
I am using an autoplot to visualise my PCA and need to add code names to each individual point but can't work out how to do it.
I have tried using geom_text but this only seems to work if using ggplot and when adding labels = TRUE, this just adds…

stakrawolf
- 11
- 2
1
vote
1 answer
How autoplot (ggplot) gets scores and loadings from prcomp
I know that there are lots of discussions out there that treat this subject matter... but every time I encounter this, I never find a consistent, satisfying answer.
I'm trying to create a very basic graphical depiction of a principal components…

Ryan Utz
- 51
- 1
- 6
1
vote
0 answers
Change decimals for proportion of variance displayed in autoplot PCA
I would like to change the number of decimals for the Proportion of Variance displayed in the axes of a PCA plot using prcomp() and autoplot(). By default it's set to 2 decimals places (92.46%, 5.31%) but I'd like to round them to 1 decimal place…

elisemillar
- 55
- 1
- 4
1
vote
1 answer
Editing the time series- decomposed plots
Is it possible to remove the empty grey boxes (highlighted inside red circle) present to the right side of the decomposed plots (attached)?
Also, it is possible to change the title fonts (highlighted inside green circle) of the individual to Times…
1
vote
0 answers
How can I prevent geom_point points from overlapping labels in R?
I am making a PCA plot using autoplot, and I wanted to enlarge the point size. I used geom_point() for this purpose, however, this makes the larger points layer on top of (and cover) the text of my variables. How can I solve this?
This is my…

Aashi
- 11
- 2
0
votes
0 answers
Using multiple continuous colour palettes in one graph (ggplot2 and/or ggfortify)
Yet another R novice working on visualisation of some basic PCA.
I'm not even sure how to present this question in a clear way:)
Basically, I have the following code, where in the original df col1 has n>3 individual rows that belong to 3 different…

NinaShch
- 1
- 2
0
votes
1 answer
How to print consistent R visualizations of decomposed time series using autoplot()
I have an R script that sometimes produces plots of decomposed time series one way and sometimes another way. I can't figure out if it's using two different autoplot() functions or what else could be making this happen. It is seemingly random: one…

dyork423
- 3
- 2
0
votes
0 answers
How to add P value to autoplot (from the ggfortify package) generating a survival graph
I am trying to put P value on a survival (Kaplan Meier Plot) using
autoplot. The survival plot is generated using survfit from the survival package. I can't use ggsurvplot to generate this graph because ggsurvfit items cannot be placed in…

Cancer Research
- 9
- 2
0
votes
0 answers
How to correctly plot an object of class RDA with autoplot package in R
I've been searching for a while now about how to customize the autoplot() function to project an RDA object with R. This function is coming with the possibility to code in ggplot() grammar. My problem is that everywhere I go on the web there is…

Iris15
- 11
- 1
0
votes
0 answers
I am looking to run an ARIMA on Time Series data. Everything in my code works up until the point where I forecast. Below is my data, code, and error
I am getting this error:
Error in switch(names(interval), day = "days", hour = "hours", minute = "mins", :
EXPR must be a length 1 vector**
When I am forecasting my ARIMA using the following line of code:
fcast = forecast(fit_arima,h=24)
I have…

Ryan Leveille
- 1
- 3
0
votes
2 answers
How to add vertical lines and text to time series plot?
I have some time series data and used autoplot function in R to plot my time series. I would like add vertical lines to the plot and text. For example, a line between 2003-2010 with text "train data", 2010-2015 "test" data and 2015- 2018…

Günal
- 751
- 1
- 14
- 29
0
votes
1 answer
How to vary line types when using the autoplot() function to help the colour-blind among us?
Running the code below plots actual data (black line) against 4-month forecasts for that data. However, the forecast lines are indistinguishable to me since I don't see colours. How can the lines be distinguished from each other (with the actual…

Village.Idyot
- 1,359
- 2
- 8