Skip to content
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

Add user defined reordering feature required for Fabian's second use case (extended version) #2

Open
mrustl opened this issue Jun 20, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request test Test something
Milestone

Comments

@mrustl
Copy link
Member

mrustl commented Jun 20, 2018

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.

@mrustl mrustl added the enhancement New feature or request label Jun 20, 2018
@mrustl mrustl self-assigned this Jun 20, 2018
@mrustl mrustl added this to the v0.1.0 milestone Jul 6, 2018
@mrustl mrustl changed the title Cross-check and add missing features based on Fabian's two use cases Add user defined reordering feature required for Fabian's second use case (extended version) Jul 6, 2018
@mrustl mrustl added the test Test something label Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request test Test something
Projects
None yet
Development

No branches or pull requests

1 participant