-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
first cut at input data figure for poster #50
Conversation
What version of EGRET do you have? I have (from EGRET * 2.6.1.9003 2017-11-22 Github (USGS-R/EGRET@b941b9f) |
EGRET 2.6.0 2016-07-27 CRAN (R 3.4.4) |
oops, yeah had the wrong function call |
9_report/src/fig_input_data.R
Outdated
ref_date = '2017-05-09' | ||
|
||
preds <- readRDS(sc_retrieve(preds_ind, remake_file)) %>% | ||
dplyr::filter(ref_date == '2017-05-09', # dplyr::filter doesn't recognize objects?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
objects? what kinds of object did you want it to recognize?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the ones defined on lines 4-6 (ref_date, etc...). Or could replace with a yml file as input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dplyr
by default uses non-standard evaluation (hence we can use ref_date
and it knows we're talking about the column). However, there's been a lot of work recently to make it friendlier to standard evaluation. This should work:
preds <- readRDS(sc_retrieve(preds_ind, remake_file)) %>%
dplyr::filter(ref_date == !!(ref_date ),
Basically, how would it know when you are talking about column names vs variable(object)? Surround it by !!
(which...apparently is said out loud "bang-bang")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah thanks! bang-bang!
!!(thanks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woot! I forgot about !!
and would have suggested just renaming ref_date
. @ldecicco-USGS 's suggestion is way better.
9_report/src/fig_input_data.R
Outdated
Site == '05465500') | ||
|
||
# example of input data for a forecast | ||
eList <- prep_inputs(nwis_site = site, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool reuse 👍
theme(axis.title.x = element_blank())) | ||
|
||
#concentration | ||
g2 <- ggplotGrob(ggplot(data = eList$Sample, aes(x = Date, y = ConcAve)) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could think about using lollipops or randomized residuals for censored data, a la https://owi.usgs.gov/blog/rResid/. @ldecicco-USGS, want to weigh in on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a favorite, but it would be a good touch to flag censored data. Could do a simple color a la https://owi.usgs.gov/blog/plotFlowConc/
You could also just use the EGRET
plot functions. multiPlotDataOverview
is a nice intro plot to the data.
Merge branch 'master' of git://github.com/USGS-R/protoloads # Conflicts: # 3_forecast/src/prep_inputs.R
3_forecast/src/prep_inputs.R
Outdated
# period for this "analysis" substitute | ||
nwm_analysis <- bind_rows( | ||
nwm_retro %>% filter(date >= as.Date('2016-11-08'), date < min(nwm_forecast$valid_date)), | ||
nwm_forecast %>% filter(ref_date == valid_date) %>% select(site_no, date = valid_date, flow)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the deletions in this file look wrong to me - i think i just added this and want to keep it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I had some merge conflicts that I think I screwed up but I'm pushing up your changes now
interactive = FALSE
and it was happy. Not sure if I have a different version of EGRET or not...