-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresults_table_complex.qmd
103 lines (80 loc) · 2.9 KB
/
results_table_complex.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
title: "Complex tasks results (tables)"
author:
- name: Piotr Tompalski
email: [email protected]
format: html
engine: knitr
lightbox: true
date: 08/15/2024
date-modified: today
---
## Complex task 1 - detailed results
```{r, echo=FALSE, message=F, warning=F}
library(tidyverse)
library(gt)
D <- readRDS("complex1.rds")
DD <- D %>%
ungroup() %>%
select(tool, cores, density=density_points_rnd, processing_time, task_mode) %>%
mutate(density_labels = fct_reorder(
paste0("Density: ", round(density), " pts/m²"), density
)) %>%
select(-density) %>%
mutate(processing_time = hms::as_hms(as_datetime(seconds_to_period(round(as.numeric(processing_time))))))
DD <- DD %>% group_by(cores, density_labels) %>%
# filter(task=="Normalization") %>%
arrange(density_labels, cores) %>%
mutate(min_proc_time=min(processing_time, na.rm=T)) %>%
mutate(delta_proc_time = processing_time - min_proc_time,
delta_proc_time_perc = round(as.numeric(delta_proc_time) / as.numeric(min_proc_time) * 100,1)) %>%
select(-min_proc_time) %>%
#replace 0 with NA
mutate(across(contains("delta"), ~if_else(.x==0, NA, .x)))
theTable <-
DD %>%
ungroup() %>%
pivot_wider(names_from = c(tool, task_mode), values_from = c(processing_time, delta_proc_time, delta_proc_time_perc))
theTable <-
theTable %>% #arrange(density, cores) %>%
group_by(density_labels) %>%
relocate(density_labels)
theTable %>%
gt() %>%
#merge columns related to processing time
cols_merge(
columns = c(processing_time_lasR_pipe, delta_proc_time_lasR_pipe, delta_proc_time_perc_lasR_pipe),
pattern = "{1}<br><small><<+{2}s +{3}%>></small>"
) %>%
cols_merge(
columns = c(processing_time_lidR_sequential, delta_proc_time_lidR_sequential, delta_proc_time_perc_lidR_sequential),
pattern = "{1}<br><small><<+{2}s +{3}%>></small>"
) %>%
cols_merge(
columns = c(processing_time_lasR_sequential, delta_proc_time_lasR_sequential, delta_proc_time_perc_lasR_sequential),
pattern = "{1}<br><small><<+{2}s +{3}%>></small>"
) %>%
cols_merge(
columns = c(processing_time_lastools_sequential, delta_proc_time_lastools_sequential, delta_proc_time_perc_lastools_sequential),
pattern = "{1}<br><small><<+{2}s +{3}%>></small>"
) %>%
tab_spanner(
label = "Processing time",
columns = c(processing_time_lasR_pipe, processing_time_lidR_sequential, processing_time_lasR_sequential, processing_time_lastools_sequential)
) %>%
cols_label(
processing_time_lasR_pipe = "lasR (pipe)",
processing_time_lidR_sequential = "lidR",
processing_time_lasR_sequential = "lasR",
processing_time_lastools_sequential = "lastools"
)%>%
cols_align(
align = "center",
columns = everything()
) %>%
cols_width(
cores ~ pct(5),
starts_with("processing_time_") ~ pct(20),
) %>%
opt_stylize(style = 1,color = "gray", add_row_striping = F)
```