Skip to content

Commit

Permalink
fix tidyr use
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Skyttner committed Feb 19, 2016
1 parent 160213b commit 283d172
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/trendy.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ turn <- function(df, species) {
res$Standard <- NA
if (!"Natt" %in% names(res))
res$Natt <- NA
rownames(res) <- parse_date_time(paste0(res$Year, "-01-01"))
rownames(res) <- parse_date_time(paste0(res$Year, "-01-01 00:00:00"),
orders = "Y!-m!*-d! H!:M!:S!")
return (res)
}

Expand All @@ -44,7 +45,7 @@ dy <- function(df, species, showgrid = FALSE) {
# stringi::stri_escape_unicode("för")
# stringi::stri_escape_unicode("år")
res <-
dygraph(df, main = paste0("Populationsindex f\\u00f6r", species)) %>%
dygraph(df, main = paste0("Populationsindex för", species)) %>%
# , ylab = "Index"
#dyRangeSelector() %>%
dySeries("Sommar", strokeWidth = 2, color = red) %>%
Expand All @@ -56,7 +57,7 @@ dy <- function(df, species, showgrid = FALSE) {
highlightSeriesBackgroundAlpha = 0.4) %>%
dyOptions(drawGrid = showgrid) %>%
dyOptions(drawPoints = TRUE, pointSize = 3) %>%
#dyEvent("1998-01-01", "Bas\\u00e5r för index", labelLoc = "bottom", color = grays[3]) %>%
#dyEvent("1998-01-01", "Basår för index", labelLoc = "bottom", color = grays[3]) %>%
dyLegend(width = 400)
return (res)
}
Expand Down
1 change: 1 addition & 0 deletions inst/shiny-apps/birdtrends/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ library(shinythemes)

library(dygraphs)
library(dplyr)
library(tidyr)

library(swedishbirdtrends)
data(birdtrends)

0 comments on commit 283d172

Please sign in to comment.