Entering edit mode
2.5 years ago
biology_inform
▴
50
Hi all, I am trying to convert my PCA plot which is created with DESeq2 to ggplot object but somehow I couldnt manage to do it.
pcaPlot <- plotPCA(dds, intgroup = "types", ntop = nrow(dds), returnData = TRUE)
annotated_pcaPlot <- ggplot(geom_text(pcaPlot,aes(label=name,group=group)))+geom_text(size = 3,position = position_nudge(y = -0.03))+
theme_test(base_family = "Arial") +geom_point(aes(color=group))+scale_color_manual(values=c('Purple3','Orangered'))
Error in
validate_mapping()
: !mapping
must be created byaes()
Runrlang::last_error()
to see where the error occurred. rlang::last_error() <error/rlang_error> Error invalidate_mapping()
: !mapping
must be created byaes()
--- Backtrace:
- ggplot2::ggplot(geom_text(pcaPlot, aes(label = name, group = group)))
- ggplot2::geom_text(pcaPlot, aes(label = name, group = group))
- ggplot2::layer(...)
- ggplot2:::validate_mapping(mapping) Run
rlang::last_trace()
to see the full context.
I am getting this error when I run like above. Do you have any recommendations ?
I believe there is an inadequate
geom_text
after introducingggplot()
that should not be here