output_path <- file.path(tempdir(), "outputs")
dir.create(output_path)
results <- TAD::launch_analysis_tad(
weights = TAD::AB[, 5:102],
weights_factor = TAD::AB[, c("Year", "Plot", "Treatment", "Bloc")],
trait_data = log(TAD::trait[["SLA"]]),
aggregation_factor_name = c("Year", "Bloc"),
statistics_factor_name = (statistics_factor_name <- c("Treatment")),
regenerate_abundance_df = TRUE,
regenerate_weighted_moments_df = TRUE,
regenerate_stat_per_obs_df = TRUE,
regenerate_stat_per_rand_df = TRUE,
weighted_moments_file = file.path(output_path, "weighted_moments.csv"),
stat_per_obs_file = file.path(output_path, "stat_per_obs.csv"),
stat_per_rand_file = file.path(output_path, "stat_per_rand.csv"),
stat_skr_param_file = file.path(output_path, "stat_skr_param.csv"),
randomization_number = 20,
seed = 1312,
significativity_threshold = c(0.05, 0.95),
lin_mod = "lm",
slope_distance = (
slope_distance <- TAD::CONSTANTS$SKEW_UNIFORM_SLOPE_DISTANCE
),
intercept_distance = (
intercept_distance <- TAD::CONSTANTS$SKEW_UNIFORM_INTERCEPT_DISTANCE
)
)
moments_graph <- TAD::moments_graph(
moments_df = results$weighted_moments,
statistics_per_observation = results$statistics_per_observation,
statistics_factor_name = statistics_factor_name,
statistics_factor_name_breaks = c("Mown_Unfertilized", "Mown_NPK"),
statistics_factor_name_col = c("#1A85FF", "#D41159"),
output_path = file.path(output_path, "moments_graph.jpeg"),
dpi = 100
)
skr_graph <- TAD::skr_graph(
moments_df = results$weighted_moments,
statistics_factor_name = statistics_factor_name,
statistics_factor_name_breaks = c("Mown_Unfertilized", "Mown_NPK"),
statistics_factor_name_col = c("#1A85FF", "#D41159"),
output_path = file.path(output_path, "skr_graph.jpeg"),
slope_distance = slope_distance,
intercept_distance = intercept_distance,
dpi = 100
)
skr_param_graph <- TAD::skr_param_graph(
skr_param = results$ses_skr,
statistics_factor_name = statistics_factor_name,
statistics_factor_name_breaks = c("Mown_Unfertilized", "Mown_NPK"),
statistics_factor_name_col = c("#1A85FF", "#D41159"),
slope_distance = slope_distance,
intercept_distance = intercept_distance,
save_skr_param_graph = file.path(output_path, "skr_param_graph.jpeg"),
dpi = 100
)
unlink(output_path, recursive = TRUE, force = TRUE)
Run the code above in your browser using DataLab