Skip to content

Commit

Permalink
One fix for duplicated site/year combos in USGS-VIZLAB#97
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan S Read committed Mar 13, 2017
1 parent e38965c commit e18b232
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/process/disch_sites.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#'@param viz the vizlab object
process.disch_sites <- function(viz){
data.in <- readDepends(viz)
browser()

library(dplyr)
sites <- data.in[['disch-data']] %>% group_by(site_no) %>%
summarize(huc = stringr::str_sub(unique(huc_cd), 1L, 2L),
Expand Down
2 changes: 2 additions & 0 deletions scripts/process/process_bar_chart.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ process.bar_chart <- function(viz){
size <- size_map_svg(data.in[['state-map']])
sites <- data.in$`disch-data`
library(dplyr)
browser()
bars <- filter(sites, year >= viz[['min-year']], year <= viz[['max-year']]) %>%
select(site_no, year) %>% distinct %>%
group_by(year) %>% tally %>% data.frame

max.sites <- max(bars$n)
Expand Down

0 comments on commit e18b232

Please sign in to comment.