why screeplot(prcomp(iris[,1:4]))
can work, but autoplot(prcomp(iris[,1:4]))
can not work ??
I really really need HELP!!
library(shiny)
library(shinydashboard)
library(ggplot2)
library(ggfortify)
ui=fluidPage(
downloadButton("downloadp2",
label="Download PDF file")
)
server=function(input,output){
output$downloadp2 <- downloadHandler(
filename = function() {"PCA.pdf"},
content = function(file) {
pdf(file)
autoplot(prcomp(iris[,1:4]))
# screeplot(prcomp(iris[,1:4]))
dev.off()
}
)
}
shinyApp(ui=ui,server=server)