Feature/phi imf efficiency#778
Conversation
| return( | ||
| list( | ||
| x = output, unit = "%", | ||
| description = "add some descriptive text here", |
There was a problem hiding this comment.
Please fill in a proper description, no placeholder text.
| @@ -0,0 +1,10 @@ | |||
| calcCostOfCapital <- function() { | |||
There was a problem hiding this comment.
Add some minimal documentation to all the calc and read functions. Minimum should be author, one short sentence what is read in/calculated, and documentation of all parameters passed to the function (if any, you don't have any).
| readIMF_PHI <- function() { | ||
|
|
||
| library(dplyr) | ||
| library(readxl) |
There was a problem hiding this comment.
don't use library commands within your function. these two can deleted without replacement. to specify functions, either use readxl::ready_xlsx (like you did below), or via @importFrom readxl read_xlsx on top of the function (only recommended when you use a function a lot and need to shorten code)
| @@ -0,0 +1,48 @@ | |||
| #' This function reads WACC markup data across technologies for each of the REMIND regions | |||
| #library(dplyr) | |||
There was a problem hiding this comment.
remove all the comments that are just commented out code and not actual documentation in this file and all the other files.
|
First steps:
|
| # ------------------------------------------------------------ | ||
| raw_clean <- raw %>% | ||
| mutate( | ||
| Efficiency = as.numeric(Efficiency), |
There was a problem hiding this comment.
Reference columns in dplyr functions as follows
Efficiency = as.numeric(.data$Efficiency)
(same goes for Remind_Region and GDP further down below)
| Efficiency = as.numeric(Efficiency), | ||
| GDP = as.numeric(gsub(",", "", GDP)) | ||
| ) %>% | ||
| filter( |
There was a problem hiding this comment.
why are you filtering NA's? your source does not have any.
|
|
||
| # Reorder columns to: t, reg, tewacc, value | ||
| data_expanded <- data_expanded %>% | ||
| select(t, reg, tewacc, value) |
There was a problem hiding this comment.
to please the linter, write select("t", "reg", "tewacc", "value")
LaviniaBaumstark
left a comment
There was a problem hiding this comment.
if this PR is o.k., it can be merged independently of the REMIND-PR. Additional inptu data files can behandled (are ignored) by our input data workflow
This PR introduces the input data for the new realization investment inefficiencies in the macro module (Available here: remindmodel/remind#2278).