首页 > 解决方案 > 是否可以在使用闪亮包制作自己的仪表板以进行可视化时添加自己的 csv 或 txt 文件

问题描述

我正在使用闪亮和闪亮的仪表板包准备仪表板,现在我想添加我的数据以准备可视化。如何实现它。这是应用程序的布局计划。

    ui <- dashboardPage(
  dashboardHeader(title = "Row layout"),
  dashboardSidebar(),
 dashboardBody()
)


 server <- function(input, output) { 

driver.csv <- read.csv("E:/RMARKDOWN/driver.csv.csv", fileEncoding = "UTF-8")

  New_DataSet1<-data.frame(driver.csv$ï..Year_AG,driver.csv$Severity_Desc,driver.csv$Injury.Type)
  New_DataSet1

  latest <- New_DataSet1[1:100,]
  latest

  d <- aggregate(latest$driver.csv.Injury.Type,  by=list(chkID = latest$driver.csv.Severity_Desc), FUN=sum)
  #barplot(d)
  renderplot(d$x)
  #barplot(d$x, xlab = d$chkID)
 # barplot(d$x, names.arg = d$chkID)

 }

 shinyApp(ui,server)

标签: rshinyshinydashboard

解决方案


推荐阅读