Create pivot list
Arguments
- pivot_data
privot data as retrieved from function pivot_data()
- arrange_cols
columns used for arranging the data (default: "process")
- method_col
name of the column containing the method (default: "lci_method"). Depending on your Umberto version you may need to set method_col to "lcia_method".
Examples
zipfile <- system.file("extdata/umberto-nxt_v7.1.0.13.503/Beispiel_Auswertung.zip",
package = "kwb.umberto")
umberto7_csv_dir <- file.path(tempdir(), "Beispiel_Auswertung")
unzip(zipfile, exdir = umberto7_csv_dir)
umberto7_rawdata <- kwb.umberto::import_rawdata(csv_dir = umberto7_csv_dir)
#> Importing csv file 'C:\Users\RUNNER~1\AppData\Local\Temp\RtmpgX0H5o/Beispiel_Auswertung/Ref_High_C+N.csv'
#> ℹ Using "','" as decimal and "'.'" as grouping mark. Use `read_delim()` for more control.
#> Rows: 19996 Columns: 12
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ";"
#> chr (11): Project, Model, Net, Timestamp, Product, LCI Method, Phase, Proces...
#> dbl (1): Quantity
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> Importing csv file 'C:\Users\RUNNER~1\AppData\Local\Temp\RtmpgX0H5o/Beispiel_Auswertung/Ref_High_C+high N.csv'
#> ℹ Using "','" as decimal and "'.'" as grouping mark. Use `read_delim()` for more control.
#> Rows: 19996 Columns: 12
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ";"
#> chr (11): Project, Model, Net, Timestamp, Product, LCI Method, Phase, Proces...
#> dbl (1): Quantity
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> Importing csv file 'C:\Users\RUNNER~1\AppData\Local\Temp\RtmpgX0H5o/Beispiel_Auswertung/Ref_Low_C+N.csv'
#> ℹ Using "','" as decimal and "'.'" as grouping mark. Use `read_delim()` for more control.
#> Rows: 19996 Columns: 12
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ";"
#> chr (11): Project, Model, Net, Timestamp, Product, LCI Method, Phase, Proces...
#> dbl (1): Quantity
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> Importing csv file 'C:\Users\RUNNER~1\AppData\Local\Temp\RtmpgX0H5o/Beispiel_Auswertung/Ref_Low_C+high N.csv'
#> ℹ Using "','" as decimal and "'.'" as grouping mark. Use `read_delim()` for more control.
#> Rows: 19996 Columns: 12
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ";"
#> chr (11): Project, Model, Net, Timestamp, Product, LCI Method, Phase, Proces...
#> dbl (1): Quantity
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
umberto7_data_grouped <- kwb.umberto::group_data(umberto7_rawdata)
umberto7_data_pivot <- kwb.umberto::pivot_data(umberto7_data_grouped)
umberto7_data_pivot_list <- kwb.umberto::create_pivot_list(umberto7_data_pivot)
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
head(umberto7_data_pivot_list)
#> $lci_method1
#> # A tibble: 14 × 6
#> # Groups: lci_method, process [14]
#> lci_method process `0a_Ref_Low_C+N` `0b_Ref_High_C+N` `0c_Ref_Low_C+high N`
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 ReCiPe Midp… T03: A… 25498. 6656. 17548.
#> 2 ReCiPe Midp… T06: C… 607. 604. 615.
#> 3 ReCiPe Midp… T07: C… 277. 281. 284.
#> 4 ReCiPe Midp… T11: E… 12520. 11694. 13973.
#> 5 ReCiPe Midp… T12: E… 2602. 2556. 2666.
#> 6 ReCiPe Midp… T13: F… 1548. 2016. 2264.
#> 7 ReCiPe Midp… T14: P… 807. 834. 823.
#> 8 ReCiPe Midp… T15: S… 1382. 1423. 1443.
#> 9 ReCiPe Midp… T21: M… 6154. 6308. 6391.
#> 10 ReCiPe Midp… T30: H… -1262. -1207. -1197.
#> 11 ReCiPe Midp… T31: E… -12697. -12457. -12596.
#> 12 ReCiPe Midp… T39: t… 1683. 1822. 1875.
#> 13 ReCiPe Midp… T51: I… 2134. 1778. 2199.
#> 14 ReCiPe Midp… T10: E… NA NA NA
#> # ℹ 1 more variable: `0d_Ref_High_C+high N` <dbl>
#>
#> $lci_method2
#> # A tibble: 14 × 6
#> # Groups: lci_method, process [14]
#> lci_method process `0a_Ref_Low_C+N` `0b_Ref_High_C+N` `0c_Ref_Low_C+high N`
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 ReCiPe Midp… T11: E… 3.24 3.03 3.62
#> 2 ReCiPe Midp… T12: E… 0.673 0.662 0.690
#> 3 ReCiPe Midp… T13: F… 1.27 1.65 1.85
#> 4 ReCiPe Midp… T14: P… 0.558 0.577 0.569
#> 5 ReCiPe Midp… T15: S… 1.07 1.10 1.12
#> 6 ReCiPe Midp… T21: M… 0.207 0.212 0.215
#> 7 ReCiPe Midp… T30: H… -0.526 -0.503 -0.499
#> 8 ReCiPe Midp… T31: E… -3.29 -3.22 -3.26
#> 9 ReCiPe Midp… T39: t… 0.883 0.956 0.984
#> 10 ReCiPe Midp… T51: I… 0.929 0.774 0.958
#> 11 ReCiPe Midp… T03: A… NA NA NA
#> 12 ReCiPe Midp… T06: C… NA NA NA
#> 13 ReCiPe Midp… T07: C… NA NA NA
#> 14 ReCiPe Midp… T10: E… NA NA NA
#> # ℹ 1 more variable: `0d_Ref_High_C+high N` <dbl>
#>
#> $lci_method3
#> # A tibble: 14 × 6
#> # Groups: lci_method, process [14]
#> lci_method process `0a_Ref_Low_C+N` `0b_Ref_High_C+N` `0c_Ref_Low_C+high N`
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 ReCiPe Midp… T10: E… 106. 53.2 32.3
#> 2 ReCiPe Midp… T11: E… 1.21 1.13 1.35
#> 3 ReCiPe Midp… T12: E… 0.251 0.246 0.257
#> 4 ReCiPe Midp… T13: F… 0.221 0.288 0.324
#> 5 ReCiPe Midp… T14: P… 0.0189 0.0196 0.0193
#> 6 ReCiPe Midp… T15: S… 0.0199 0.0205 0.0208
#> 7 ReCiPe Midp… T21: M… 0.0156 0.0160 0.0162
#> 8 ReCiPe Midp… T30: H… -0.00995 -0.00951 -0.00943
#> 9 ReCiPe Midp… T31: E… -1.22 -1.20 -1.21
#> 10 ReCiPe Midp… T39: t… 0.0563 0.0609 0.0627
#> 11 ReCiPe Midp… T51: I… 0.112 0.0936 0.116
#> 12 ReCiPe Midp… T03: A… NA NA NA
#> 13 ReCiPe Midp… T06: C… NA NA NA
#> 14 ReCiPe Midp… T07: C… NA NA NA
#> # ℹ 1 more variable: `0d_Ref_High_C+high N` <dbl>
#>
#> $lci_method4
#> # A tibble: 14 × 6
#> # Groups: lci_method, process [14]
#> lci_method process `0a_Ref_Low_C+N` `0b_Ref_High_C+N` `0c_Ref_Low_C+high N`
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 ReCiPe Midp… T11: E… 853. 797. 952.
#> 2 ReCiPe Midp… T12: E… 177. 174. 182.
#> 3 ReCiPe Midp… T13: F… 355. 463. 520.
#> 4 ReCiPe Midp… T14: P… 52.2 54.0 53.2
#> 5 ReCiPe Midp… T15: S… 292. 300. 305.
#> 6 ReCiPe Midp… T21: M… 38.4 39.4 39.9
#> 7 ReCiPe Midp… T30: H… -18.4 -17.6 -17.4
#> 8 ReCiPe Midp… T31: E… -865. -849. -858.
#> 9 ReCiPe Midp… T39: t… 141. 153. 157.
#> 10 ReCiPe Midp… T51: I… 265. 221. 273.
#> 11 ReCiPe Midp… T03: A… NA NA NA
#> 12 ReCiPe Midp… T06: C… NA NA NA
#> 13 ReCiPe Midp… T07: C… NA NA NA
#> 14 ReCiPe Midp… T10: E… NA NA NA
#> # ℹ 1 more variable: `0d_Ref_High_C+high N` <dbl>
#>
#> $lci_method5
#> # A tibble: 14 × 6
#> # Groups: lci_method, process [14]
#> lci_method process `0a_Ref_Low_C+N` `0b_Ref_High_C+N` `0c_Ref_Low_C+high N`
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 ReCiPe Midp… T11: E… 5.33 4.98 5.95
#> 2 ReCiPe Midp… T12: E… 1.11 1.09 1.14
#> 3 ReCiPe Midp… T13: F… 3.63 4.72 5.31
#> 4 ReCiPe Midp… T14: P… 0.801 0.829 0.817
#> 5 ReCiPe Midp… T15: S… 4.91 5.05 5.13
#> 6 ReCiPe Midp… T21: M… 0.508 0.520 0.527
#> 7 ReCiPe Midp… T30: H… -0.569 -0.544 -0.539
#> 8 ReCiPe Midp… T31: E… -5.41 -5.30 -5.36
#> 9 ReCiPe Midp… T39: t… 1.34 1.45 1.49
#> 10 ReCiPe Midp… T51: I… 2.22 1.85 2.28
#> 11 ReCiPe Midp… T03: A… NA NA NA
#> 12 ReCiPe Midp… T06: C… NA NA NA
#> 13 ReCiPe Midp… T07: C… NA NA NA
#> 14 ReCiPe Midp… T10: E… NA NA NA
#> # ℹ 1 more variable: `0d_Ref_High_C+high N` <dbl>
#>
#> $lci_method6
#> # A tibble: 14 × 6
#> # Groups: lci_method, process [14]
#> lci_method process `0a_Ref_Low_C+N` `0b_Ref_High_C+N` `0c_Ref_Low_C+high N`
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 ReCiPe Midp… T03: A… 3.79 3.78 3.81
#> 2 ReCiPe Midp… T06: C… 0.325 0.324 0.329
#> 3 ReCiPe Midp… T10: E… 1463. 730. 1103.
#> 4 ReCiPe Midp… T11: E… 1.03 0.964 1.15
#> 5 ReCiPe Midp… T12: E… 0.214 0.211 0.220
#> 6 ReCiPe Midp… T13: F… 0.251 0.326 0.367
#> 7 ReCiPe Midp… T14: P… 2.97 3.07 3.03
#> 8 ReCiPe Midp… T15: S… 0.174 0.179 0.182
#> 9 ReCiPe Midp… T21: M… 0.250 0.256 0.260
#> 10 ReCiPe Midp… T30: H… -0.0432 -0.0413 -0.0410
#> 11 ReCiPe Midp… T31: E… -1.05 -1.03 -1.04
#> 12 ReCiPe Midp… T39: t… 0.180 0.195 0.201
#> 13 ReCiPe Midp… T51: I… 0.206 0.171 0.212
#> 14 ReCiPe Midp… T07: C… NA NA NA
#> # ℹ 1 more variable: `0d_Ref_High_C+high N` <dbl>
#>
umberto10_csv_dir <- system.file("extdata/umberto-lca+_v10.1.0.3.146",
package = "kwb.umberto")
umberto10_rawdata <- kwb.umberto::import_rawdata(csv_dir = umberto10_csv_dir)
#> Importing csv file 'D:/a/_temp/Library/kwb.umberto/extdata/umberto-lca+_v10.1.0.3.146/smartech2_model-v0.1.0_input-v0.3.1.csv'
#> ℹ Using "','" as decimal and "'.'" as grouping mark. Use `read_delim()` for more control.
#> Rows: 8456 Columns: 15
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ";"
#> chr (14): Project, Model, Net, Timestamp, Product, Product Name, Product Arr...
#> dbl (1): Quantity
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
umberto10_data_grouped <- kwb.umberto::group_data(umberto10_rawdata)
umberto10_data_pivot <- kwb.umberto::pivot_data(umberto10_data_grouped)
umberto10_data_pivot_list <- kwb.umberto::create_pivot_list(umberto10_data_pivot)
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
#> Joining with `by = join_by(lci_method, process)`
head(umberto10_data_pivot_list)
#> $lci_method1
#> # A tibble: 9 × 3
#> # Groups: lci_method, process [9]
#> lci_method process `0_Reference_Agri`
#> <chr> <chr> <dbl>
#> 1 ReCiPe Midpoint (H) w/o LT - climate change w/o LT… T03: A… 3780859.
#> 2 ReCiPe Midpoint (H) w/o LT - climate change w/o LT… T06: C… 180612.
#> 3 ReCiPe Midpoint (H) w/o LT - climate change w/o LT… T07: C… 289429.
#> 4 ReCiPe Midpoint (H) w/o LT - climate change w/o LT… T14: P… 392609.
#> 5 ReCiPe Midpoint (H) w/o LT - climate change w/o LT… T15: S… 110.
#> 6 ReCiPe Midpoint (H) w/o LT - climate change w/o LT… T21: f… -217232.
#> 7 ReCiPe Midpoint (H) w/o LT - climate change w/o LT… T31: E… -1172633.
#> 8 ReCiPe Midpoint (H) w/o LT - climate change w/o LT… T4: El… 13314949.
#> 9 ReCiPe Midpoint (H) w/o LT - climate change w/o LT… T10: E… NA
#>
#> $lci_method2
#> # A tibble: 9 × 3
#> # Groups: lci_method, process [9]
#> lci_method process `0_Reference_Agri`
#> <chr> <chr> <dbl>
#> 1 ReCiPe Midpoint (H) w/o LT - freshwater ecotoxicit… T14: P… 281.
#> 2 ReCiPe Midpoint (H) w/o LT - freshwater ecotoxicit… T15: S… 0.0843
#> 3 ReCiPe Midpoint (H) w/o LT - freshwater ecotoxicit… T21: f… -2760.
#> 4 ReCiPe Midpoint (H) w/o LT - freshwater ecotoxicit… T31: E… -308.
#> 5 ReCiPe Midpoint (H) w/o LT - freshwater ecotoxicit… T4: El… 2056.
#> 6 ReCiPe Midpoint (H) w/o LT - freshwater ecotoxicit… T03: A… NA
#> 7 ReCiPe Midpoint (H) w/o LT - freshwater ecotoxicit… T06: C… NA
#> 8 ReCiPe Midpoint (H) w/o LT - freshwater ecotoxicit… T07: C… NA
#> 9 ReCiPe Midpoint (H) w/o LT - freshwater ecotoxicit… T10: E… NA
#>
#> $lci_method3
#> # A tibble: 9 × 3
#> # Groups: lci_method, process [9]
#> lci_method process `0_Reference_Agri`
#> <chr> <chr> <dbl>
#> 1 ReCiPe Midpoint (H) w/o LT - freshwater eutrophica… T10: E… 3010.
#> 2 ReCiPe Midpoint (H) w/o LT - freshwater eutrophica… T14: P… 8.99
#> 3 ReCiPe Midpoint (H) w/o LT - freshwater eutrophica… T15: S… 0.00160
#> 4 ReCiPe Midpoint (H) w/o LT - freshwater eutrophica… T21: f… 1861.
#> 5 ReCiPe Midpoint (H) w/o LT - freshwater eutrophica… T31: E… -54.1
#> 6 ReCiPe Midpoint (H) w/o LT - freshwater eutrophica… T4: El… 770.
#> 7 ReCiPe Midpoint (H) w/o LT - freshwater eutrophica… T03: A… NA
#> 8 ReCiPe Midpoint (H) w/o LT - freshwater eutrophica… T06: C… NA
#> 9 ReCiPe Midpoint (H) w/o LT - freshwater eutrophica… T07: C… NA
#>
#> $lci_method4
#> # A tibble: 9 × 3
#> # Groups: lci_method, process [9]
#> lci_method process `0_Reference_Agri`
#> <chr> <chr> <dbl>
#> 1 ReCiPe Midpoint (H) w/o LT - human toxicity w/o LT… T14: P… 23785.
#> 2 ReCiPe Midpoint (H) w/o LT - human toxicity w/o LT… T15: S… 23.2
#> 3 ReCiPe Midpoint (H) w/o LT - human toxicity w/o LT… T21: f… -110028.
#> 4 ReCiPe Midpoint (H) w/o LT - human toxicity w/o LT… T31: E… -75226.
#> 5 ReCiPe Midpoint (H) w/o LT - human toxicity w/o LT… T4: El… 571687.
#> 6 ReCiPe Midpoint (H) w/o LT - human toxicity w/o LT… T03: A… NA
#> 7 ReCiPe Midpoint (H) w/o LT - human toxicity w/o LT… T06: C… NA
#> 8 ReCiPe Midpoint (H) w/o LT - human toxicity w/o LT… T07: C… NA
#> 9 ReCiPe Midpoint (H) w/o LT - human toxicity w/o LT… T10: E… NA
#>
#> $lci_method5
#> # A tibble: 9 × 3
#> # Groups: lci_method, process [9]
#> lci_method process `0_Reference_Agri`
#> <chr> <chr> <dbl>
#> 1 ReCiPe Midpoint (H) w/o LT - marine ecotoxicity w/… T14: P… 385.
#> 2 ReCiPe Midpoint (H) w/o LT - marine ecotoxicity w/… T15: S… 0.391
#> 3 ReCiPe Midpoint (H) w/o LT - marine ecotoxicity w/… T21: f… -1822.
#> 4 ReCiPe Midpoint (H) w/o LT - marine ecotoxicity w/… T31: E… -549.
#> 5 ReCiPe Midpoint (H) w/o LT - marine ecotoxicity w/… T4: El… 3173.
#> 6 ReCiPe Midpoint (H) w/o LT - marine ecotoxicity w/… T03: A… NA
#> 7 ReCiPe Midpoint (H) w/o LT - marine ecotoxicity w/… T06: C… NA
#> 8 ReCiPe Midpoint (H) w/o LT - marine ecotoxicity w/… T07: C… NA
#> 9 ReCiPe Midpoint (H) w/o LT - marine ecotoxicity w/… T10: E… NA
#>
#> $lci_method6
#> # A tibble: 9 × 3
#> # Groups: lci_method, process [9]
#> lci_method process `0_Reference_Agri`
#> <chr> <chr> <dbl>
#> 1 ReCiPe Midpoint (H) w/o LT - marine eutrophication… T03: A… 592.
#> 2 ReCiPe Midpoint (H) w/o LT - marine eutrophication… T06: C… 96.7
#> 3 ReCiPe Midpoint (H) w/o LT - marine eutrophication… T10: E… 261651.
#> 4 ReCiPe Midpoint (H) w/o LT - marine eutrophication… T14: P… 1437.
#> 5 ReCiPe Midpoint (H) w/o LT - marine eutrophication… T15: S… 0.0140
#> 6 ReCiPe Midpoint (H) w/o LT - marine eutrophication… T21: f… 10613.
#> 7 ReCiPe Midpoint (H) w/o LT - marine eutrophication… T31: E… -171.
#> 8 ReCiPe Midpoint (H) w/o LT - marine eutrophication… T4: El… 1393.
#> 9 ReCiPe Midpoint (H) w/o LT - marine eutrophication… T07: C… NA
#>