Mercurial > repos > ecology > ecology_link_between_var
annotate graph_stat_presence_abs.r @ 0:c7dd4706f982 draft
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
author | ecology |
---|---|
date | Tue, 27 Jul 2021 16:55:49 +0000 |
parents | |
children | 8e8867bf491a |
rev | line source |
---|---|
0
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
1 #Rscript |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
2 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
3 ################################ |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
4 ## Median and dispersion ## |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
5 ################################ |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
6 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
7 #####Packages : Cowplot |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
8 # ggplot2 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
9 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
10 #####Load arguments |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
11 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
12 args <- commandArgs(trailingOnly = TRUE) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
13 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
14 if (length(args) == 0) { |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
15 stop("This tool needs at least one argument") |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
16 }else{ |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
17 table <- args[1] |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
18 hr <- args[2] |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
19 var <- as.numeric(args[3]) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
20 spe <- as.numeric(args[4]) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
21 loc <- as.numeric(args[5]) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
22 time <- as.numeric(args[6]) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
23 } |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
24 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
25 if (hr == "false") { |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
26 hr <- FALSE |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
27 }else{ |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
28 hr <- TRUE |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
29 } |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
30 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
31 #####Import data |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
32 data <- read.table(table, sep = "\t", dec = ".", header = hr, fill = TRUE, encoding = "UTF-8") |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
33 data <- na.omit(data) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
34 colvar <- colnames(data)[var] |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
35 colspe <- colnames(data)[spe] |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
36 colloc <- colnames(data)[loc] |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
37 coltime <- colnames(data)[time] |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
38 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
39 data <- data[grep("^$", data[, spe], invert = TRUE), ] |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
40 time <- as.integer(substring(data[, time], first = 1, last = 4)) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
41 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
42 #####Your analysis |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
43 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
44 ####Median and data dispersion#### |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
45 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
46 #Median |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
47 graph_median <- function(data, var) { |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
48 graph_median <- ggplot2::ggplot(data, ggplot2::aes_string(y = var)) + |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
49 ggplot2::geom_boxplot(color = "darkblue") + |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
50 ggplot2::theme(legend.position = "none") + ggplot2::ggtitle("Median") |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
51 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
52 return(graph_median) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
53 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
54 } |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
55 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
56 #Dispersion |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
57 dispersion <- function(data, var, var2) { |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
58 graph_dispersion <- ggplot2::ggplot(data) + |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
59 ggplot2::geom_point(ggplot2::aes_string(x = var2, y = var, color = var2)) + |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
60 ggplot2::scale_fill_brewer(palette = "Set3") + |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
61 ggplot2::theme(legend.position = "none", axis.text.x = ggplot2::element_text(angle = 90, vjust = 0.5, hjust = 1), plot.title = ggplot2::element_text(color = "black", size = 12, face = "bold")) + ggplot2::ggtitle("Dispersion") |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
62 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
63 return(graph_dispersion) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
64 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
65 } |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
66 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
67 #The 2 graph |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
68 med_disp <- function(med, disp) { |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
69 graph <- cowplot::plot_grid(med, disp, ncol = 1, nrow = 2, vjust = -5, scales = "free") |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
70 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
71 ggplot2::ggsave("Med_Disp.png", graph, width = 12, height = 20, units = "cm") |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
72 } |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
73 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
74 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
75 #### Zero problem in data #### |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
76 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
77 #Put data in form |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
78 make_table_analyse <- function(data, var, spe, var2, var3) { |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
79 tab <- reshape(data |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
80 , v.names = var |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
81 , idvar = c(var2, var3) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
82 , timevar = spe |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
83 , direction = "wide") |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
84 tab[is.na(tab)] <- 0 ###### remplace les na par des 0 / replace NAs by 0 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
85 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
86 colnames(tab) <- sub(var, "", colnames(tab))### remplace le premier pattern "abond." par le second "" / replace the column names "abond." by "" |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
87 return(tab) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
88 } |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
89 data_num <- make_table_analyse(data, colvar, colspe, colloc, coltime) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
90 nb_spe <- length(unique(data[, spe])) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
91 nb_col <- ncol(data_num) - nb_spe + 1 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
92 data_num <- data_num[, nb_col:ncol(data_num)] |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
93 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
94 #Presence of zeros in the data |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
95 mat_corr <- function(data) { |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
96 cor(data) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
97 } |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
98 p_mat <- function(data) { |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
99 ggcorrplot::cor_pmat(data) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
100 } # compute a matrix of correlation p-values |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
101 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
102 graph_corr <- function(data_num) { |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
103 graph <- ggcorrplot::ggcorrplot(mat_corr(data_num), method = "circle", p.mat = p_mat(data_num), #barring the no significant coefficient |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
104 ggtheme = ggplot2::theme_gray, colors = c("#00AFBB", "#E7B800", "#FC4E07")) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
105 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
106 ggplot2::ggsave("0_pb.png", graph) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
107 } |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
108 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
109 ##Med and disp |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
110 med <- graph_median(data, var = colvar) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
111 disp <- dispersion(data, var = colvar, var2 = colspe) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
112 med_disp(med = med, disp = disp) |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
113 |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
114 ##O problem |
c7dd4706f982
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 2f883743403105d9cac6d267496d985100da3958"
ecology
parents:
diff
changeset
|
115 graph_corr(data_num) |