-
Notifications
You must be signed in to change notification settings - Fork 0
Add user defined reordering feature required for Fabian's second use case (extended version) #2
Copy link
Copy link
Open
Labels
Milestone
Description
Use case A:
Y:\Z-Exchange\Fabian\Basis_Variante
data is grouped by: model
group_data <- function(raw_data,
grouping_paras = c("lci_method", "model", "process", "unit"),
grouping_function = "sum") {
Use case B:
Y:\Z-Exchange\Fabian\Erweiterte_Variante
data is grouped by: product
group_data <- function(raw_data,
grouping_paras = c("lci_method", "product", "process", "unit"),
grouping_function = "sum")
additional function for reordering grouped data based on user defined csv configuration file:
product_meta <- data.frame(product = names(data_pivot)[3:ncol(data_pivot)],
priority = NA)
product_meta <- data.frame(product = names(data_pivot)[3:ncol(data_pivot)],
priority = NA)
write.csv2(product_meta,file = "product_meta.csv",row.names = FALSE)
product_meta <- read.csv2(file = "product_meta.csv",
stringsAsFactors = FALSE) %>%
dplyr::arrange_("priority")
data_pivot_ordered <- data_pivot[,c(names(data_pivot)[1:2],product_meta$product)]
data_pivot_list <- create_pivot_list(data_pivot_ordered)
Source code for both versions:
data-processing-r.zip
This function needs to be integrated in the R package and documented. Then after testing if the results are equal to the R scripts before a first release of kwb.umberto can be published.
Reactions are currently unavailable