-
Notifications
You must be signed in to change notification settings - Fork 1
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
Geom pandemics #157
base: master
Are you sure you want to change the base?
Geom pandemics #157
Conversation
initial code
deleted because it was a text file, not a script
Create pandemics data set
replaced last row with updated information on 2020 covid-recession
replace url and change from read.csv to read_xlsx - unsure if this makes errors
change date to Date in code
When trying to run geom_pandemics, this error occurs: |
Now works as designed to show the COVID-19 pandemic. Code should be refined and potentially integrated with geom_recessions to minimize duplicate code (but this works as proof of concept).
@jmaltman heads up, I had a bit of time and was able to get the function to work. I did not address the |
It would also be better practice for the code if we streamlined/reduced duplication between geom_recessions and geom_pandemics. This can certainly be done, and ideally we would have a consolidated documentation too - but woudl take some work and require some changes to arguments (the most important one of which would be changing |
Dummy data does not work for this, so just using the fake data.
Previous change caused error
Shift to using dedicated recessions and pandemics data files
This commit combines geom_pandemics and geom_recessions to allow for shared code and more efficient documentation.
Fixes error in vignette development
OK @jmaltman I would appreciate if you could see whether this works on your system, including in edge cases. I think it's a functional PR at this stage. When we are ready, we will need to increment the cmapplot version number and add a change log. |
Testing this function out with the update piece of the function to insert my own pandemics data, I found two errors come up.
|
Hmm, I am not able to replicate the bug for the labels. When I add a new pandemic table by copying the existing one and adding a new row, it shows up fine for me with the accurate label. Could you paste the code you used to yield this bug? The ongoing one requires an end date by the way that the function currently works. You could add some code to do that automatically, if you wanted, but in the recessions table a user supplied one wouldn't work unless you put a far out date on it. |
@dlcomeaux, I created my own data frame instead of adding to the existing pandemic table. new_df <- data.frame(start_char = c("Jan 1980", "Apr 2009", "Mar 2015"), new_df <- ggplot(df, mapping = aes(x = year_dec, y = value)) + |
@jmaltman OK this has identified a few things for me.
|
I'm moving the update part of the geom_pandemics function up so that it occurs before the label part of the function. Hopefully that helps with the labeling issue when new data is used.
created geom_pandemics.R (not ready)
updated geom_recessions.R with new URL
updated sysdata.rda
created pandemics.rda
created R script to create pandemics.rda