-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.R
28 lines (23 loc) · 836 Bytes
/
output.R
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
source("setup.R")
load("Data/ctrp_cor_short_signif.RData")
source("visualization.R")
# Generate summary statistics
summary_stats <- ctrp_cor_short_signif %>%
summarise(
mean_cor_pearson = mean(cor_pearson, na.rm = TRUE),
median_cor_pearson = median(cor_pearson, na.rm = TRUE),
mean_cor_spearman = mean(cor_spearman, na.rm = TRUE),
median_cor_spearman = median(cor_spearman, na.rm = TRUE),
total_significant = n()
)
# Write summary to file
write.csv(summary_stats, "Output/summary_statistics.csv", row.names = FALSE)
# Generate PDF report
pdf("Output/analysis_report.pdf", width = 11, height = 8.5)
print(volcano_pearson)
print(volcano_spearman)
dev.off()
# Export significant correlations
write.csv(ctrp_cor_short_signif, "Output/significant_correlations.csv", row.names = FALSE)
# Clean up
rm(list = ls())