首页 > 解决方案 > 如何从我的计算机上加载我的数据框?

问题描述

我已经改进了一个用于 Shiny App 的大型数据框,但我无法弄清楚如何让 Shiny 使用该数据框,我目前的尝试如下,但这失败了,它无法加载我期待的情节。

contVariables <- c("percent_ctax_a_c" = "Percentage of population in council tax bands A - C",
                   "percent_ctax_d_e" = "Percentage of population in council tax bands D - E",
                   "percent_ctax_f_h" = "Percentage of population in council tax bands F - H",
                   "crimes_per_10000_popn" = "Crimes (per 10'000 population)",
                   "hosp_admissions_per_100000_popn" = "Hospital Admissions (per 100'000 population)",
               "median_house_price_GBP" = "Median House Price (GBP)",
                   "mean_year_jobseekers_ages_25_49" = "Percentage of population aged 25-49 claiming Jobseekers Allowance",
                   "percent_waste_recycled" = "Percentage of waste recycled",
                   "waste_kg_per_capita" = "Waste per capita (kg)",
                   "percent_people_near_derelict" = "Percentage of    people near derelict sites")

shinyServer(function(input, output) {

  output$plot <- renderPlot( {
    data("Final_Data.csv")
    p <- ggplot(data=data) +
        aes_string(x=input$x, y=input$y) +
      aes_string(colour=input$Council)
    p <- p + geom_point() +
            xlab(contVariables[input$x]) + 
            ylab(contVariables[input$y])  
    p
} )    

})

标签: rshiny

解决方案


推荐阅读