eRror:alpha必须是1个或长度x。

问题描述 投票:0回答:1
当我使用

renderPlotly

运行此代码时。它给了我错误,但是没有渲染图,它可以正常工作。您能帮我使用RenderPlotly修复此代码吗?预先感谢
output$tot_finalized_claims1 <- renderPlotly({ req(input$yearSelectInput) #filter df to be used in graph claims1 <- newly_formatted_logResults %>% filter(YEAR == input$yearSelectInput) %>% filter(PEND == "CMI") %>% select(YEAR,MONTH_NUM,PEND, TOTAL_FINALIZE,TOTAL) data_pcode <- summarize(group_by(claims1,MONTH_NUM), actual_auto = round(sum(as.numeric(TOTAL_FINALIZE),na.rm = TRUE)/sum(as.numeric(TOTAL),na.rm = TRUE),digits = 2)) data_pcode <- data.frame(data_pcode) ggplot(data = data_pcode,aes(x = MONTH_NUM, y = actual_auto )) + geom_point() + geom_line() + # add the points and lines stat_QC(method = "XmR" # specify QC charting method auto.label = T, # Use Autolabels label.digits = 2, # Use two digit in the label show.1n2.sigma = T # Show 1 and two sigma lines )+ labs(x = "Months",y = "Automation Rate",title = paste("Actual automations by CMI Pend code"))+ geom_text(aes(label=paste(actual_auto ,"%")), position=position_dodge(width=0.95), vjust=-0.5)+ scale_x_continuous(breaks = 1:12,labels = c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"))+ scale_y_continuous(breaks = seq(0.0, 1.0, 0.1)) }) #end tot finalized plot summary

	
从您甚至没有使用
r ggplot2 plot shiny visualization
1个回答
0
投票
函数创建图的事实来看,如果您想生成绘图,则必须记住两件事


在服务器部分renderPlotly

而不是
    renderPlot
  1. 在UI中,而不是
    plotlyOutput
  2. 您可以尝试此代码以查看其工作原理:
    plotOutput
        
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.