-
Notifications
You must be signed in to change notification settings - Fork 71
new clean_data library of functions for preparing new data #247
Conversation
@Clare2D in the current version of I don't understand what the purpose of that is. Can you explain it to me... or is it not necessary... or should it be doing something more robust (e.g. always set the currently most recent exchange rate to 1)? |
This was a temporary solution as we didn't had currency data for 2019Q2. Best to delete this. It won't impact what we're doing at the moment. Thanks. |
@Clare2D the Is this desired/necessary behavior? My intuition would be that these functions should always return what they're intended to return (actual data) and it should be up to the caller to decide whether to ask for the data at all and/or what to do with the data once it has received it. For example, I would think that this... if (inc_emission_factors) {
average_emission_data <- get_average_emission_data()
} else {
average_emission_data <- tibble()
} or this... average_emission_data <- get_average_emission_data()
if (!inc_emission_factors) { average_emission_data <- tibble() } is more logical than... average_emission_data <- get_average_emission_data(inc_emission_factors) same applies to the |
@Clare2D the current version of One alternative way to achieve this would be to add an additional function that first tests whether if (can_get_fund_data()) {
fund_data <- get_and_clean_fund_data()
} else {
fund_data <- tibble() # or fund_data <- NA if really necessary
} or at least (if it doesn't cause errors elsewhere) it would be preferable to return an object of the same type. thoughts anyone (@maurolepore @jdhoffa @jacobvjk)? |
From what I can tell, the So it would indeed seem like the safest approach to return an empty tibble, as far as I can tell.. maybe someone else knows of any other issues related to this? |
@cjyetman is this stale, WIP, or ready for review? |
WIP... or better WOTBB (work-on-the-back-burner) |
…PACTA_analysis into new-clean_data-script
This seems stale, and also in a deprecated repo. Ok to Close? |
Can you imagine trying to resolve all the merge conflicts AND adapting this to work with the new data!?!? LOL closing |
hhahahhahaa, sounds like a fun Xmas holiday task :-O |
Just got an email about this... Just wanted to say... you should definitely work on this over xmas! Hope you're all well! |
WIP: draft PR to add a new clean_data.R script that contains improved versions of all the functions needed to pull in, clean, merge, etc. a new set of data for a PACTA analysis, including a robust testing regime for each of the functions.
this should address #344 before being considered complete
also should possibly address 2DegreesInvesting/create_interactive_report/issues/268
closes #235