R:Shiny - 如何基于daterangeInput进行子集化然后制作条形图

时间:2015-02-06 04:47:42

标签: r shiny

我有这个数据框:

    date      sessions      Fuentes
1 2014-12-01      197       Directo
2 2014-12-01        1       Referencias
3 2014-12-01        7       Social Media
4 2014-12-01       13       SEO
5 2014-12-01        1       Email
6 2014-12-01        1       Referencias

这是使用dput()之后的数据:

 structure(list(date = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L,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 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 
8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 
8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 
8L, 8L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 12L, 12L, 12L, 12L, 12L, 
12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 
12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 
12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 
12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 
12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 13L, 13L, 13L, 13L, 
13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 
13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 
13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 
13L, 13L, 13L, 13L, 13L, 13L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 
14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 
14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 
14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 
14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 
14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 
15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 
15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 
15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 
15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 
15L, 15L, 15L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 
16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 
16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 
16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 
16L, 16L, 16L, 16L, 16L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 
17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 
17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 
17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 
17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 
17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 
17L, 17L, 17L, 17L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 
18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 
18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 
18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 19L, 19L, 
19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 
19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 
19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 
19L, 19L, 19L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 
20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 
20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 
20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 
20L, 20L, 20L, 20L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 
21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 
21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 
21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 
21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 22L, 22L, 22L, 22L, 22L, 
22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 
22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 
22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 
22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 23L, 23L, 23L, 23L, 23L, 
23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 
23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 
23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 24L, 24L, 24L, 24L, 
24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 
24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 
24L, 24L, 24L, 24L, 24L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 
25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 
25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 
25L, 25L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 
26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 
26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 
26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 
26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 27L, 27L, 27L, 27L, 
27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 
27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 
27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 
27L, 27L, 27L, 27L, 27L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 
28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 
28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 
28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 29L, 29L, 
29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 
29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 
29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 
29L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 
30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 
30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 
30L, 30L, 30L, 30L, 30L, 30L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 
31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 
31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L), .Label = c("2014-12-01", 
"2014-12-02", "2014-12-03", "2014-12-04", "2014-12-05", "2014-12-06", 
"2014-12-07", "2014-12-08", "2014-12-09", "2014-12-10", "2014-12-11", 
"2014-12-12", "2014-12-13", "2014-12-14", "2014-12-15", "2014-12-16", 
"2014-12-17", "2014-12-18", "2014-12-19", "2014-12-20", "2014-12-21", 
"2014-12-22", "2014-12-23", "2014-12-24", "2014-12-25", "2014-12-26", 
"2014-12-27", "2014-12-28", "2014-12-29", "2014-12-30", "2014-12-31"
), class = "factor"), sessions = c(197L, 1L, 7L, 13L, 1L, 1L, 
10L, 1L, 3L, 3L, 5L, 3L, 566L, 1L, 27L, 159L, 7L, 1L, 6L, 1L, 
1L, 4L, 1L, 6L, 10L, 129L, 1L, 7L, 2L, 1L, 10L, 1L, 5L, 6L, 9L, 
1L, 28L, 1L, 7L, 386L, 1L, 146L, 1L, 89L, 41L, 9L, 1L, 1L, 1L, 
6L, 3L, 4L, 182L, 1L, 5L, 8L, 2L, 1L, 1L, 4L, 1L, 1L, 2L, 3L, 
2L, 524L, 4L, 26L, 1L, 152L, 4L, 2L, 3L, 1L, 2L, 2L, 1L, 5L, 
10L, 142L, 1L, 1L, 8L, 1L, 3L, 1L, 1L, 1L, 1L, 7L, 4L, 13L, 3L, 
375L, 3L, 2L, 147L, 1L, 101L, 29L, 4L, 1L, 1L, 2L, 3L, 1L, 1L, 
2L, 1L, 7L, 5L, 5L, 224L, 3L, 12L, 1L, 7L, 2L, 1L, 4L, 141L, 
4L, 632L, 2L, 2L, 32L, 1L, 138L, 1L, 1L, 9L, 5L, 1L, 1L, 1L, 
2L, 1L, 6L, 3L, 139L, 4L, 1L, 9L, 1L, 1L, 5L, 9L, 8L, 36L, 1L, 
537L, 1L, 2L, 5L, 3L, 174L, 1L, 106L, 39L, 9L, 2L, 2L, 2L, 3L, 
1L, 6L, 3L, 2L, 689L, 1L, 14L, 2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 7L, 5L, 6L, 5L, 5L, 5L, 5L), .Label = c("Adwords", "Campañas", 
"Directo", "Email", "Referencias", "SEO", "Social Media"), class = "factor")), .Names = c("date", 
"sessions", "Fuentes"), class = "data.frame", row.names = c(NA, 
-1724L))

在Shiny App中,想要根据用户指定的数据范围绘制Fuentes的条形图。我在我的ui.R中使用daterangeInput,但无法用它来绘制我需要的内容。

我的ui.R

library(shiny)



# Define the overall UI
shinyUI(

  # Use a fluid Bootstrap layout
  fluidPage(    

    # Give the page a title
     br(),
     br(),
     titlePanel("Visitas por fuente"),

    # Generate a row with a sidebar
     sidebarLayout(      

      # Define the sidebar with one input



       sidebarPanel(
       dateRangeInput("dates", label = h3("Date range"),
                       start = "2014-12-01", end = "2014-12-31")

      ),

      # Create a spot for the barplot
      mainPanel(
         plotOutput("VisitasFuente")  
      )

    )
  )
) 

我的服务器.R ###已编辑 - 现在可以进行绘图,但标签显示为从底部到顶部的模糊。

 library(ggplot2)
 library(dplyr)
 require(scales)




 Visitas_Por_Fuente <- read.csv("D:\\RCoursera\\Movistar-  App-2\\Visitas_Por_Fuente_Dic.csv")
labels = c("Directo", "Email", "Referencias", "SEO", "Social Media")
Visitas_Por_Fuente$date <- as.Date(Visitas_Por_Fuente$date)





 shinyServer(


  function(input, output) {



output$VisitasFuente <- renderPlot({

  # Filter the data based on user selection month     
  date_seq <- seq(input$dates[1], input$dates[2], by = "day")


  #VisitasData <- filter(Visitas_Por_Fuente, date >= input$dates[1],
  #                     date <= input$dates[2])


  VisitasData <- filter(Visitas_Por_Fuente, date %in% date_seq  & Fuentes %in% labels)

  # Bar graph using ggplot2 library 
  ggplot(VisitasData, aes(factor(Fuentes), sessions, fill = Fuentes)) + 
    geom_bar(stat="identity", position = "dodge") +
    geom_text(aes(label = comma(sessions)),  position=position_dodge(width=0.9), vjust=-0.25) +
    scale_fill_manual(breaks = c("0", "1", "3", "6", "9"),
                      labels = c("Directo", "Email", "References",
                                 "SEO", "Social Media"),
                      values = c("#E69F00", "#56B4E9", "#009E73", 
                                 "#F0E442", "#0072B2"))

})


 })
通过加载相应的包来解决这个问题

感谢@goodtimeslim,我已经提出了你给我的建议。但现在我明白了:

匹配错误(x,表,nomatch = 0L):   &#39;匹配&#39;需要矢量参数

它可能是什么?再次感谢。

1 个答案:

答案 0 :(得分:1)

好的,首先,您需要告诉R,Visitas_Por_Fuente $ date是一个日期,Visitas_Por_Fuente$date <- as.Date(Visitas_Por_Fuente$date)

您可以在开始导入数据后立即执行此操作。 现在,您希望使用日期输入在服务器文件中创建一系列日期,如下所示:

date_seq <- seq(input$dates[1], input$dates[2], by = "day")

现在您只需要更改过滤器,以便日期在该序列中,如下所示:

VisitasData <- filter(Visitas_Por_Fuente, date %in% date_seq)

现在我承认并没有解决所有问题,我的ggplot代码出现了一些奇怪的错误,但这将解决子集问题。

你的ggplot的这个问题是你的数据有7个变量,但是你只给它5个信息。如果你只想要那5个变量,那么在顶部(导入你的数据后),写下这个:

labels = c("Directo", "Email", "References", "SEO", "Social Media")

然后,对于你的情节,摆脱scale_manual线并将其替换为:

scale_x_discrete(limit = labels)

那将强制那些5,并且此刻,它将以R想要的任何颜色来做。如果你想改变它,我会让你弄明白其余的。

让我知道这是否足够清楚,或者你只是想要整个server.r代码。

编辑:好的,我修好了。你的代码中有错误,你有&#34;参考&#34;,但在你的数据中,它是&#34;参考&#34;。所以现在,假设您仍然只需要这五个变量,而不是全部7个,请执行此操作:更改标签(位于顶部),如下所示:

labels = c("Directo", "Email", "Referencias", "SEO", "Social Media")

像这样更改过滤器:

VisitasData <- filter(Visitas_Por_Fuente, date %in% date_seq  & Fuentes %in% labels)

然后你可以摆脱我所拥有的那条scale_x_discrete线,然后把你的线放回去。现在它应该全部工作了。 (除了在manual_scale部分编辑你的标签以反映正确的&#34; Referencias&#34;。

编辑2:这是在我的计算机上运行良好的完整server.r。我为了一致性/清晰度做了一些细微的改变,但其他方面大致相同。

library(ggplot2)


Visitas_Por_Fuente <- read.csv("visitas.csv") ## put your path here
labelsF = c("Directo", "Email", "Referencias", "SEO", "Social Media")
Visitas_Por_Fuente$date <- as.Date(Visitas_Por_Fuente$date)





shinyServer(


  function(input, output) {



    output$VisitasFuente <- renderPlot({

      # Filter the data based on user selection month     
      date_seq <- seq(input$dates[1], input$dates[2], by = "day")


      #VisitasData <- filter(Visitas_Por_Fuente, date >= input$dates[1],
      #                     date <= input$dates[2])


      VisitasData <- filter(Visitas_Por_Fuente, date %in% date_seq  & Fuentes %in% labelsF)

      # Bar graph using ggplot2 library 
      ggplot(VisitasData, aes(factor(Fuentes), sessions, fill = Fuentes)) + 
        geom_bar(stat="identity", position = "dodge") +
        scale_fill_manual(breaks = c("0", "1", "3", "6", "9"),
                          labels = labelsF,
                          values = c("#E69F00", "#56B4E9", "#009E73", 
                                     "#F0E442", "#0072B2"))

    })


  })