"Occupied Patches Proportion" = "orange",
"Variability Metrics" = "red",
"Hypervolume Estimation" = "brown",
"Hypervolume Dissimilarity" = "black"
)
# First, create a mapping of TestCase to TestGroup
test_case_to_group <- c(
# Beta Diversity
"beta_diversity_1" = "Beta Diversity",
"beta_diversity_2" = "Beta Diversity",
"beta_diversity_3" = "Beta Diversity",
# Spatial Beta Diversity
"spatial_beta_div_1" = "Spatial Beta Diversity",
"spatial_beta_div_2" = "Spatial Beta Diversity",
"spatial_beta_div_3" = "Spatial Beta Diversity",
# Temporal Beta Diversity
"temporal_beta_div_1" = "Temporal Beta Diversity",
"temporal_beta_div_2" = "Temporal Beta Diversity",
"temporal_beta_div_3" = "Temporal Beta Diversity",
# Dispersal-niche continuum index
"DNCI_multigroup_result" = "Dispersal-niche continuum index",
# Occupied Patches Proportion
"prop_patches_result" = "Occupied Patches Proportion",
# Variability Metrics
"CV_meta_result" = "Variability Metrics",
# Hypervolume Estimation
"hypervolume_det_result" = "Hypervolume Estimation",
# Hypervolume Dissimilarity
"hypervolume_dis_result" = "Hypervolume Dissimilarity"
)
# Create TestCase order based on the group order
test_case_order <- c(
# Beta Diversity
"beta_diversity_1", "beta_diversity_2", "beta_diversity_3",
# Spatial Beta Diversity
"spatial_beta_div_1", "spatial_beta_div_2", "spatial_beta_div_3",
# Temporal Beta Diversity
"temporal_beta_div_1", "temporal_beta_div_2", "temporal_beta_div_3",
# Dispersal-niche continuum index
"DNCI_multigroup_result",
# Occupied Patches Proportion
"prop_patches_result",
# Variability Metrics
"CV_meta_result",
# Hypervolume Estimation
"hypervolume_det_result",
# Hypervolume Dissimilarity
"hypervolume_dis_result"
)
# Convert TestGroup and TestCase to factors with the specified order
median_ci_df  <- median_ci_df  %>%
# Ensure TestGroup is assigned correctly based on TestCase
mutate(
TestGroup = test_case_to_group[TestCase],
# Then convert both to factors with the proper ordering
TestGroup = factor(TestGroup, levels = test_group_order),
TestCase = factor(TestCase, levels = test_case_order)
)
# Now create the plot with the ordered data
p <- ggplot(median_ci_df ,
aes(x = DataSize, y = Speedup_median,
group = TestCase,
color = TestGroup)) +
# Add horizontal line at y=0 first
geom_hline(yintercept = 0, linetype = "dashed", color = "darkgray", size = 0.5) +
# All lines are now solid
geom_line(size = 0.7) +
# Only add points for beta diversity test cases with different shapes
geom_point(data = median_ci_df  %>% filter(IsBetaDiv),
aes(shape = factor(TestVariant)),
size = 4) +
geom_errorbar(aes(ymin = Lower_CI, ymax = Upper_CI),
width = 0.2,
alpha = 0.7) +
scale_color_manual(
values = test_group_colors,
name = "Test Group"
) +
scale_shape_manual(
values = c(16, 17, 15),
name = "Variant",
label = c(
"Abundance, quant=true",
"Abundance, quant=false",
"Presence, quant=false"
)
) +
theme_cowplot() +
scale_x_discrete(limits = c("Small", "Medium", "Large")) +
labs(y = "Speedup", x = "Data Size")
p
ggsave("result/speedup.png", dpi=300, width = 10, height = 5, bg="white")
full_result_memory<-full_result_julia%>%
select(TestCase, memory)%>%
rename(memory_julia=memory)%>%
left_join(full_result_r)%>%
select(TestCase, memory_julia, memory)%>%
rename(memory_r=memory)%>%
filter(!is.na(memory_r))%>%
mutate(TestCase = case_when(
TestCase == "beta_diversity_1" ~ "Beta Diversity (Abundance, quant=true)",
TestCase == "beta_diversity_2" ~ "Beta Diversity (Abundance, quant=false)",
TestCase == "beta_diversity_3" ~ "Beta Diversity (Presence, quant=false)",
TestCase == "spatial_beta_div_1" ~ "Spatial Beta Diversity (Abundance, quant=true)",
TestCase == "spatial_beta_div_2" ~ "Spatial Beta Diversity (Abundance, quant=false)",
TestCase == "spatial_beta_div_3" ~ "Spatial Beta Diversity (Presence, quant=false)",
TestCase == "temporal_beta_div_1" ~ "Temporal Beta Diversity (Abundance, quant=true)",
TestCase == "temporal_beta_div_2" ~ "Temporal Beta Diversity (Abundance, quant=false)",
TestCase == "temporal_beta_div_3" ~ "Temporal Beta Diversity (Presence, quant=false)",
TestCase == "DNCI_multigroup_result" ~ "Dispersal-niche continuum index",
TestCase == "prop_patches_result" ~ "Occupied Patches Proportion",
TestCase == "CV_meta_result" ~ "Variability Metrics",
TestCase == "hypervolume_det_result" ~ "Hypervolume Estimation",
TestCase == "hypervolume_dis_result" ~ "Hypervolume Dissimilarity",
TRUE ~ TestCase  # Keep original value if no match
))%>%
mutate(TestCase = factor(TestCase, levels = test_case_order)) %>%
arrange(TestCase)
medium_result_memory<-medium_result_julia%>%
select(TestCase, memory)%>%
rename(memory_julia=memory)%>%
left_join(medium_result_r)%>%
select(TestCase, memory_julia, memory)%>%
rename(memory_r=memory)%>%
filter(!is.na(memory_r))%>%
mutate(TestCase = case_when(
TestCase == "beta_diversity_1" ~ "Beta Diversity (Abundance, quant=true)",
TestCase == "beta_diversity_2" ~ "Beta Diversity (Abundance, quant=false)",
TestCase == "beta_diversity_3" ~ "Beta Diversity (Presence, quant=false)",
TestCase == "spatial_beta_div_1" ~ "Spatial Beta Diversity (Abundance, quant=true)",
TestCase == "spatial_beta_div_2" ~ "Spatial Beta Diversity (Abundance, quant=false)",
TestCase == "spatial_beta_div_3" ~ "Spatial Beta Diversity (Presence, quant=false)",
TestCase == "temporal_beta_div_1" ~ "Temporal Beta Diversity (Abundance, quant=true)",
TestCase == "temporal_beta_div_2" ~ "Temporal Beta Diversity (Abundance, quant=false)",
TestCase == "temporal_beta_div_3" ~ "Temporal Beta Diversity (Presence, quant=false)",
TestCase == "DNCI_multigroup_result" ~ "Dispersal-niche continuum index",
TestCase == "prop_patches_result" ~ "Occupied Patches Proportion",
TestCase == "CV_meta_result" ~ "Variability Metrics",
TestCase == "hypervolume_det_result" ~ "Hypervolume Estimation",
TestCase == "hypervolume_dis_result" ~ "Hypervolume Dissimilarity",
TRUE ~ TestCase  # Keep original value if no match
))%>%
mutate(TestCase = factor(TestCase, levels = test_case_order)) %>%
arrange(TestCase)
small_result_memory<-small_result_julia%>%
select(TestCase, memory)%>%
rename(memory_julia=memory)%>%
left_join(small_result_r)%>%
select(TestCase, memory_julia, memory)%>%
rename(memory_r=memory)%>%
filter(!is.na(memory_r))%>%
mutate(TestCase = case_when(
TestCase == "beta_diversity_1" ~ "Beta Diversity (Abundance, quant=true)",
TestCase == "beta_diversity_2" ~ "Beta Diversity (Abundance, quant=false)",
TestCase == "beta_diversity_3" ~ "Beta Diversity (Presence, quant=false)",
TestCase == "spatial_beta_div_1" ~ "Spatial Beta Diversity (Abundance, quant=true)",
TestCase == "spatial_beta_div_2" ~ "Spatial Beta Diversity (Abundance, quant=false)",
TestCase == "spatial_beta_div_3" ~ "Spatial Beta Diversity (Presence, quant=false)",
TestCase == "temporal_beta_div_1" ~ "Temporal Beta Diversity (Abundance, quant=true)",
TestCase == "temporal_beta_div_2" ~ "Temporal Beta Diversity (Abundance, quant=false)",
TestCase == "temporal_beta_div_3" ~ "Temporal Beta Diversity (Presence, quant=false)",
TestCase == "DNCI_multigroup_result" ~ "Dispersal-niche continuum index",
TestCase == "prop_patches_result" ~ "Occupied Patches Proportion",
TestCase == "CV_meta_result" ~ "Variability Metrics",
TestCase == "hypervolume_det_result" ~ "Hypervolume Estimation",
TestCase == "hypervolume_dis_result" ~ "Hypervolume Dissimilarity",
TRUE ~ TestCase  # Keep original value if no match
))%>%
mutate(TestCase = factor(TestCase, levels = test_case_order)) %>%
arrange(TestCase)
write.csv(small_result_memory, "result/small_df_memory.csv")
write.csv(medium_result_memory, "result/medium_df_memory.csv")
write.csv(full_result_memory, "result/full_df_memory.csv")
full_result_memory
test_case_order <- c(
"Beta Diversity (Abundance, quant=true)",
"Beta Diversity (Abundance, quant=false)",
"Beta Diversity (Presence, quant=false)",
"Spatial Beta Diversity (Abundance, quant=true)",
"Spatial Beta Diversity (Abundance, quant=false)",
"Spatial Beta Diversity (Presence, quant=false)",
"Temporal Beta Diversity (Abundance, quant=true)",
"Temporal Beta Diversity (Abundance, quant=false)",
"Temporal Beta Diversity (Presence, quant=false)",
"Dispersal-niche continuum index",
"Occupied Patches Proportion",
"Variability Metrics",
"Hypervolume Estimation",
"Hypervolume Dissimilarity"
)
full_result_memory<-full_result_julia%>%
select(TestCase, memory)%>%
rename(memory_julia=memory)%>%
left_join(full_result_r)%>%
select(TestCase, memory_julia, memory)%>%
rename(memory_r=memory)%>%
filter(!is.na(memory_r))%>%
mutate(TestCase = case_when(
TestCase == "beta_diversity_1" ~ "Beta Diversity (Abundance, quant=true)",
TestCase == "beta_diversity_2" ~ "Beta Diversity (Abundance, quant=false)",
TestCase == "beta_diversity_3" ~ "Beta Diversity (Presence, quant=false)",
TestCase == "spatial_beta_div_1" ~ "Spatial Beta Diversity (Abundance, quant=true)",
TestCase == "spatial_beta_div_2" ~ "Spatial Beta Diversity (Abundance, quant=false)",
TestCase == "spatial_beta_div_3" ~ "Spatial Beta Diversity (Presence, quant=false)",
TestCase == "temporal_beta_div_1" ~ "Temporal Beta Diversity (Abundance, quant=true)",
TestCase == "temporal_beta_div_2" ~ "Temporal Beta Diversity (Abundance, quant=false)",
TestCase == "temporal_beta_div_3" ~ "Temporal Beta Diversity (Presence, quant=false)",
TestCase == "DNCI_multigroup_result" ~ "Dispersal-niche continuum index",
TestCase == "prop_patches_result" ~ "Occupied Patches Proportion",
TestCase == "CV_meta_result" ~ "Variability Metrics",
TestCase == "hypervolume_det_result" ~ "Hypervolume Estimation",
TestCase == "hypervolume_dis_result" ~ "Hypervolume Dissimilarity",
TRUE ~ TestCase  # Keep original value if no match
))
full_result_memory
full_result_memory<-full_result_julia%>%
select(TestCase, memory)%>%
rename(memory_julia=memory)%>%
left_join(full_result_r)%>%
select(TestCase, memory_julia, memory)%>%
rename(memory_r=memory)%>%
filter(!is.na(memory_r))%>%
mutate(TestCase = case_when(
TestCase == "beta_diversity_1" ~ "Beta Diversity (Abundance, quant=true)",
TestCase == "beta_diversity_2" ~ "Beta Diversity (Abundance, quant=false)",
TestCase == "beta_diversity_3" ~ "Beta Diversity (Presence, quant=false)",
TestCase == "spatial_beta_div_1" ~ "Spatial Beta Diversity (Abundance, quant=true)",
TestCase == "spatial_beta_div_2" ~ "Spatial Beta Diversity (Abundance, quant=false)",
TestCase == "spatial_beta_div_3" ~ "Spatial Beta Diversity (Presence, quant=false)",
TestCase == "temporal_beta_div_1" ~ "Temporal Beta Diversity (Abundance, quant=true)",
TestCase == "temporal_beta_div_2" ~ "Temporal Beta Diversity (Abundance, quant=false)",
TestCase == "temporal_beta_div_3" ~ "Temporal Beta Diversity (Presence, quant=false)",
TestCase == "DNCI_multigroup_result" ~ "Dispersal-niche continuum index",
TestCase == "prop_patches_result" ~ "Occupied Patches Proportion",
TestCase == "CV_meta_result" ~ "Variability Metrics",
TestCase == "hypervolume_det_result" ~ "Hypervolume Estimation",
TestCase == "hypervolume_dis_result" ~ "Hypervolume Dissimilarity",
TRUE ~ TestCase  # Keep original value if no match
))%>%
mutate(TestCase = factor(TestCase, levels = test_case_order)) %>%
arrange(TestCase)
full_result_memory
full_result_memory<-full_result_julia%>%
select(TestCase, memory)%>%
rename(memory_julia=memory)%>%
left_join(full_result_r)%>%
select(TestCase, memory_julia, memory)%>%
rename(memory_r=memory)%>%
filter(!is.na(memory_r))%>%
mutate(TestCase = case_when(
TestCase == "beta_diversity_1" ~ "Beta Diversity (Abundance, quant=true)",
TestCase == "beta_diversity_2" ~ "Beta Diversity (Abundance, quant=false)",
TestCase == "beta_diversity_3" ~ "Beta Diversity (Presence, quant=false)",
TestCase == "spatial_beta_div_1" ~ "Spatial Beta Diversity (Abundance, quant=true)",
TestCase == "spatial_beta_div_2" ~ "Spatial Beta Diversity (Abundance, quant=false)",
TestCase == "spatial_beta_div_3" ~ "Spatial Beta Diversity (Presence, quant=false)",
TestCase == "temporal_beta_div_1" ~ "Temporal Beta Diversity (Abundance, quant=true)",
TestCase == "temporal_beta_div_2" ~ "Temporal Beta Diversity (Abundance, quant=false)",
TestCase == "temporal_beta_div_3" ~ "Temporal Beta Diversity (Presence, quant=false)",
TestCase == "DNCI_multigroup_result" ~ "Dispersal-niche continuum index",
TestCase == "prop_patches_result" ~ "Occupied Patches Proportion",
TestCase == "CV_meta_result" ~ "Variability Metrics",
TestCase == "hypervolume_det_result" ~ "Hypervolume Estimation",
TestCase == "hypervolume_dis_result" ~ "Hypervolume Dissimilarity",
TRUE ~ TestCase  # Keep original value if no match
))%>%
mutate(TestCase = factor(TestCase, levels = test_case_order)) %>%
arrange(TestCase)
medium_result_memory<-medium_result_julia%>%
select(TestCase, memory)%>%
rename(memory_julia=memory)%>%
left_join(medium_result_r)%>%
select(TestCase, memory_julia, memory)%>%
rename(memory_r=memory)%>%
filter(!is.na(memory_r))%>%
mutate(TestCase = case_when(
TestCase == "beta_diversity_1" ~ "Beta Diversity (Abundance, quant=true)",
TestCase == "beta_diversity_2" ~ "Beta Diversity (Abundance, quant=false)",
TestCase == "beta_diversity_3" ~ "Beta Diversity (Presence, quant=false)",
TestCase == "spatial_beta_div_1" ~ "Spatial Beta Diversity (Abundance, quant=true)",
TestCase == "spatial_beta_div_2" ~ "Spatial Beta Diversity (Abundance, quant=false)",
TestCase == "spatial_beta_div_3" ~ "Spatial Beta Diversity (Presence, quant=false)",
TestCase == "temporal_beta_div_1" ~ "Temporal Beta Diversity (Abundance, quant=true)",
TestCase == "temporal_beta_div_2" ~ "Temporal Beta Diversity (Abundance, quant=false)",
TestCase == "temporal_beta_div_3" ~ "Temporal Beta Diversity (Presence, quant=false)",
TestCase == "DNCI_multigroup_result" ~ "Dispersal-niche continuum index",
TestCase == "prop_patches_result" ~ "Occupied Patches Proportion",
TestCase == "CV_meta_result" ~ "Variability Metrics",
TestCase == "hypervolume_det_result" ~ "Hypervolume Estimation",
TestCase == "hypervolume_dis_result" ~ "Hypervolume Dissimilarity",
TRUE ~ TestCase  # Keep original value if no match
))%>%
mutate(TestCase = factor(TestCase, levels = test_case_order)) %>%
arrange(TestCase)
small_result_memory<-small_result_julia%>%
select(TestCase, memory)%>%
rename(memory_julia=memory)%>%
left_join(small_result_r)%>%
select(TestCase, memory_julia, memory)%>%
rename(memory_r=memory)%>%
filter(!is.na(memory_r))%>%
mutate(TestCase = case_when(
TestCase == "beta_diversity_1" ~ "Beta Diversity (Abundance, quant=true)",
TestCase == "beta_diversity_2" ~ "Beta Diversity (Abundance, quant=false)",
TestCase == "beta_diversity_3" ~ "Beta Diversity (Presence, quant=false)",
TestCase == "spatial_beta_div_1" ~ "Spatial Beta Diversity (Abundance, quant=true)",
TestCase == "spatial_beta_div_2" ~ "Spatial Beta Diversity (Abundance, quant=false)",
TestCase == "spatial_beta_div_3" ~ "Spatial Beta Diversity (Presence, quant=false)",
TestCase == "temporal_beta_div_1" ~ "Temporal Beta Diversity (Abundance, quant=true)",
TestCase == "temporal_beta_div_2" ~ "Temporal Beta Diversity (Abundance, quant=false)",
TestCase == "temporal_beta_div_3" ~ "Temporal Beta Diversity (Presence, quant=false)",
TestCase == "DNCI_multigroup_result" ~ "Dispersal-niche continuum index",
TestCase == "prop_patches_result" ~ "Occupied Patches Proportion",
TestCase == "CV_meta_result" ~ "Variability Metrics",
TestCase == "hypervolume_det_result" ~ "Hypervolume Estimation",
TestCase == "hypervolume_dis_result" ~ "Hypervolume Dissimilarity",
TRUE ~ TestCase  # Keep original value if no match
))%>%
mutate(TestCase = factor(TestCase, levels = test_case_order)) %>%
arrange(TestCase)
write.csv(small_result_memory, "result/small_df_memory.csv")
write.csv(medium_result_memory, "result/medium_df_memory.csv")
write.csv(full_result_memory, "result/full_df_memory.csv")
full_result_memory
median_ci_df
median_ci_all_save
median_ci_all
median_ci_all %>%
mutate(TestCase = case_when(
TestCase == "beta_diversity_1" ~ "Beta Diversity (Abundance, quant=true)",
TestCase == "beta_diversity_2" ~ "Beta Diversity (Abundance, quant=false)",
TestCase == "beta_diversity_3" ~ "Beta Diversity (Presence, quant=false)",
TestCase == "spatial_beta_div_1" ~ "Spatial Beta Diversity (Abundance, quant=true)",
TestCase == "spatial_beta_div_2" ~ "Spatial Beta Diversity (Abundance, quant=false)",
TestCase == "spatial_beta_div_3" ~ "Spatial Beta Diversity (Presence, quant=false)",
TestCase == "temporal_beta_div_1" ~ "Temporal Beta Diversity (Abundance, quant=true)",
TestCase == "temporal_beta_div_2" ~ "Temporal Beta Diversity (Abundance, quant=false)",
TestCase == "temporal_beta_div_3" ~ "Temporal Beta Diversity (Presence, quant=false)",
TestCase == "DNCI_multigroup_result" ~ "Dispersal-niche continuum index",
TestCase == "prop_patches_result" ~ "Occupied Patches Proportion",
TestCase == "CV_meta_result" ~ "Variability Metrics",
TestCase == "hypervolume_det_result" ~ "Hypervolume Estimation",
TestCase == "hypervolume_dis_result" ~ "Hypervolume Dissimilarity",
TRUE ~ TestCase  # Keep original value if no match
))%>%
mutate(TestCase = factor(TestCase, levels = test_case_order)) %>%
arrange(TestCase)
median_ci_all
median_ci_all %>%
mutate(TestCase = case_when(
TestCase == "beta_diversity_1" ~ "Beta Diversity (Abundance, quant=true)",
TestCase == "beta_diversity_2" ~ "Beta Diversity (Abundance, quant=false)",
TestCase == "beta_diversity_3" ~ "Beta Diversity (Presence, quant=false)",
TestCase == "spatial_beta_div_1" ~ "Spatial Beta Diversity (Abundance, quant=true)",
TestCase == "spatial_beta_div_2" ~ "Spatial Beta Diversity (Abundance, quant=false)",
TestCase == "spatial_beta_div_3" ~ "Spatial Beta Diversity (Presence, quant=false)",
TestCase == "temporal_beta_div_1" ~ "Temporal Beta Diversity (Abundance, quant=true)",
TestCase == "temporal_beta_div_2" ~ "Temporal Beta Diversity (Abundance, quant=false)",
TestCase == "temporal_beta_div_3" ~ "Temporal Beta Diversity (Presence, quant=false)",
TestCase == "DNCI_multigroup_result" ~ "Dispersal-niche continuum index",
TestCase == "prop_patches_result" ~ "Occupied Patches Proportion",
TestCase == "CV_meta_result" ~ "Variability Metrics",
TestCase == "hypervolume_det_result" ~ "Hypervolume Estimation",
TestCase == "hypervolume_dis_result" ~ "Hypervolume Dissimilarity",
TRUE ~ TestCase  # Keep original value if no match
))
min(median_ci_all$Speedup_median)
max(median_ci_all$Speedup_median)
full_result_memory
408.45025635/43.962699890
p
p <- ggplot(median_ci_df ,
aes(x = DataSize, y = Speedup_median,
group = TestCase,
color = TestGroup)) +
# Add horizontal line at y=1 first
geom_hline(yintercept = 1, linetype = "dashed", color = "darkgray", size = 0.5) +
# All lines are now solid
geom_line(size = 0.7) +
# Only add points for beta diversity test cases with different shapes
geom_point(data = median_ci_df  %>% filter(IsBetaDiv),
aes(shape = factor(TestVariant)),
size = 4) +
geom_errorbar(aes(ymin = Lower_CI, ymax = Upper_CI),
width = 0.2,
alpha = 0.7) +
scale_color_manual(
values = test_group_colors,
name = "Test Group"
) +
scale_shape_manual(
values = c(16, 17, 15),
name = "Variant",
label = c(
"Abundance, quant=true",
"Abundance, quant=false",
"Presence, quant=false"
)
) +
theme_cowplot() +
scale_x_discrete(limits = c("Small", "Medium", "Large")) +
labs(y = "Speedup", x = "Data Size")
p
# Now create the plot with the ordered data
p <- ggplot(median_ci_df ,
aes(x = DataSize, y = Speedup_median,
group = TestCase,
color = TestGroup)) +
# Add horizontal line at y=1 first
geom_hline(yintercept = 1, linetype = "dashed", color = "darkgray", size = 0.5) +
# All lines are now solid
geom_line(size = 0.7) +
# Only add points for beta diversity test cases with different shapes
geom_point(data = median_ci_df  %>% filter(IsBetaDiv),
aes(shape = factor(TestVariant)),
size = 4) +
geom_errorbar(aes(ymin = Lower_CI, ymax = Upper_CI),
width = 0.2,
alpha = 0.7) +
scale_color_manual(
values = test_group_colors,
name = "Test Group"
) +
scale_shape_manual(
values = c(16, 17, 15),
name = "Variant",
label = c(
"Abundance, quant=true",
"Abundance, quant=false",
"Presence, quant=false"
)
) +
theme_cowplot() +
scale_x_discrete(limits = c("Small", "Medium", "Large")) +
labs(y = "Speedup", x = "Data Size")
library(dplyr)
library(ggplot2)
library(cowplot)
library(ggrepel)
library(boot)
# Now create the plot with the ordered data
p <- ggplot(median_ci_df ,
aes(x = DataSize, y = Speedup_median,
group = TestCase,
color = TestGroup)) +
# Add horizontal line at y=1 first
geom_hline(yintercept = 1, linetype = "dashed", color = "darkgray", size = 0.5) +
# All lines are now solid
geom_line(size = 0.7) +
# Only add points for beta diversity test cases with different shapes
geom_point(data = median_ci_df  %>% filter(IsBetaDiv),
aes(shape = factor(TestVariant)),
size = 4) +
geom_errorbar(aes(ymin = Lower_CI, ymax = Upper_CI),
width = 0.2,
alpha = 0.7) +
scale_color_manual(
values = test_group_colors,
name = "Test Group"
) +
scale_shape_manual(
values = c(16, 17, 15),
name = "Variant",
label = c(
"Abundance, quant=true",
"Abundance, quant=false",
"Presence, quant=false"
)
) +
theme_cowplot() +
scale_x_discrete(limits = c("Small", "Medium", "Large")) +
labs(y = "Speedup", x = "Data Size")
p
# Now create the plot with the ordered data
p <- ggplot(median_ci_df ,
aes(x = DataSize, y = Speedup_median,
group = TestCase,
color = TestGroup)) +
# Add horizontal line at y=1 first
geom_hline(yintercept = 1, linetype = "dashed", color = "darkgray") +
# All lines are now solid
geom_line(size = 0.7) +
# Only add points for beta diversity test cases with different shapes
geom_point(data = median_ci_df  %>% filter(IsBetaDiv),
aes(shape = factor(TestVariant)),
size = 4) +
geom_errorbar(aes(ymin = Lower_CI, ymax = Upper_CI),
width = 0.2,
alpha = 0.7) +
scale_color_manual(
values = test_group_colors,
name = "Test Group"
) +
scale_shape_manual(
values = c(16, 17, 15),
name = "Variant",
label = c(
"Abundance, quant=true",
"Abundance, quant=false",
"Presence, quant=false"
)
) +
theme_cowplot() +
scale_x_discrete(limits = c("Small", "Medium", "Large")) +
labs(y = "Speedup", x = "Data Size")
p
pwd()
pd
pd()
ggsave("result/speedup.png", dpi=300, width = 10, height = 5, bg="white")
setwd("~/Documents/research/MetaCommunityMetrics.jl/benchmarks")
ggsave("result/speedup.png", dpi=300, width = 10, height = 5, bg="white")
