annotate cb_dissimilarity.r @ 1:f941081e03f0 draft default tip

planemo upload for repository https://github.com/Marie59/champ_blocs commit 075fd90d1a39ae7912b48549e5537971635b9620
author ecology
date Sat, 18 Mar 2023 16:48:52 +0000
parents 42b51a52e308
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1 # author: "Jonathan Richir"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
2 # date: "01 October 2022"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
3
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
4
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
5 #Rscript
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
6
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
7 ###############################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
8 ## ##
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
9 ###############################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
10
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
11 #####Packages : dplyr
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
12 # tidyr
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
13 # readr
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
14 # writexl
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
15 # stringr
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
16 # readxl
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
17 # tibble
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
18 # lubridate
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
19 # cowplot
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
20 # magrittr
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
21 # rmarkdown
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
22 library(magrittr)
1
f941081e03f0 planemo upload for repository https://github.com/Marie59/champ_blocs commit 075fd90d1a39ae7912b48549e5537971635b9620
ecology
parents: 0
diff changeset
23
0
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
24 #####Load arguments
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
25
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
26 args <- commandArgs(trailingOnly = TRUE)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
27
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
28 #####Import data
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
29
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
30 if (length(args) < 1) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
31 stop("This tool needs at least 1 argument")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
32 }else {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
33 fiche_val <- args[1]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
34 input_data <- args[2]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
35 choice <- args[3]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
36 choice_date <- as.numeric(args[4])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
37 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
38
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
39 #############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
40 # #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
41 # Loading and cleaning data #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
42 # #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
43 #############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
44 # load qecb data
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
45
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
46 qecb <- read.csv2(input_data, header = TRUE, fileEncoding = "Latin1") # fileEncoding = "Latin1", cfr é in variable names
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
47
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
48 # import csv files ficheterrain
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
49
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
50 fiche <- read.csv2(fiche_val, header = TRUE, fileEncoding = "Latin1") # fileEncoding = "Latin1", cfr é in variable names
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
51
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
52 ## work on "Fiche terrain"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
53
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
54 date_fiche <- as.Date(stringr::str_sub(fiche$date.sortie, end = 10), origin = "1970-01-01")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
55 fiche <- tibble::add_column(fiche, date_fiche, .after = "date.sortie")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
56 rm(date_fiche)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
57
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
58 ## qecb vs fiche terrain
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
59
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
60 fiche_red <- dplyr::filter(fiche, fiche$ID.Fiche %in% unique(qecb[, c("id")]))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
61
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
62 id_count <- qecb %>% dplyr::group_by(id) %>% dplyr::count()
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
63 id_count <- dplyr::rename(id_count, "ID.Fiche" = "id")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
64 id_count <- data.frame(id_count)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
65 fiche_red <- dplyr::left_join(fiche_red, id_count)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
66
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
67 # rep fiche terrain information
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
68 fiche_expanded <- fiche_red[rep(row.names(fiche_red), fiche_red$n), 1:ncol(fiche_red)]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
69 fiche_expanded <- dplyr::rename(fiche_expanded, "id" = "ID.Fiche")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
70
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
71 ## merge qecb data and ficheterrain information
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
72
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
73 qecb <- dplyr::bind_cols(qecb, fiche_expanded)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
74 qecb <- dplyr::rename(qecb, "id_qecb" = "id...1")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
75 qecb <- dplyr::rename(qecb, "id_fiche" = "id...68")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
76
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
77 rm(fiche_expanded, fiche_red, id_count)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
78
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
79 qecb <- qecb %>% tidyr::separate(date_fiche, c("Year", "Month", "Day"), sep = "-", remove = FALSE)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
80
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
81
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
82 ## quadrat nb : in contrast to ivr df, quadrat number is missing for many observations in qecb df ; but from the Numero.Photo variable (boulder photo associated to field data collection), I could get back most missing quadrat numbers
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
83
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
84 quadrat <- stringr::str_extract(qecb$Numero.Photo, "Q[12345]")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
85 qecb <- tibble::add_column(qecb, quadrat, .after = "Numero.Photo")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
86 rm(quadrat)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
87
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
88 # check
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
89 quadrat_bis <- rep(NA, length = nrow(qecb))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
90 qecb <- tibble::add_column(qecb, quadrat_bis, .after = "quadrat")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
91 rm(quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
92
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
93 qecb$quadrat_bis <- ifelse(qecb$Numéro.Bloc.échantillon %in% c(1, 2) & qecb$Type.Bloc == "Bloc mobile", "Q1", qecb$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
94 qecb$quadrat_bis <- ifelse(qecb$Numéro.Bloc.échantillon %in% c(3, 4) & qecb$Type.Bloc == "Bloc mobile", "Q2", qecb$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
95 qecb$quadrat_bis <- ifelse(qecb$Numéro.Bloc.échantillon %in% c(5, 6) & qecb$Type.Bloc == "Bloc mobile", "Q3", qecb$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
96 qecb$quadrat_bis <- ifelse(qecb$Numéro.Bloc.échantillon %in% c(7, 8) & qecb$Type.Bloc == "Bloc mobile", "Q4", qecb$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
97 qecb$quadrat_bis <- ifelse(qecb$Numéro.Bloc.échantillon %in% c(9, 10) & qecb$Type.Bloc == "Bloc mobile", "Q5", qecb$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
98
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
99
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
100 qecb$quadrat_bis <- ifelse(qecb$Numéro.Bloc.échantillon == 1 & qecb$Type.Bloc %in% c("Bloc fixé", "Roche en place"), "Q1", qecb$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
101 qecb$quadrat_bis <- ifelse(qecb$Numéro.Bloc.échantillon == 2 & qecb$Type.Bloc %in% c("Bloc fixé", "Roche en place"), "Q2", qecb$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
102 qecb$quadrat_bis <- ifelse(qecb$Numéro.Bloc.échantillon == 3 & qecb$Type.Bloc %in% c("Bloc fixé", "Roche en place"), "Q3", qecb$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
103 qecb$quadrat_bis <- ifelse(qecb$Numéro.Bloc.échantillon == 4 & qecb$Type.Bloc %in% c("Bloc fixé", "Roche en place"), "Q4", qecb$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
104 qecb$quadrat_bis <- ifelse(qecb$Numéro.Bloc.échantillon == 5 & qecb$Type.Bloc %in% c("Bloc fixé", "Roche en place"), "Q5", qecb$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
105
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
106 ## I create two new variables for Site names, one for data analysis and one for data reporting. Only works for actual ivr df with 22 sites !
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
107
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
108 # Name for data analysis
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
109
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
110 qecb <- tibble::add_column(qecb, Site = qecb$zone.habitat, .after = "ID.Fiche")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
111
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
112 for (x in seq_along(qecb$Site)) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
113 if (grepl(pattern = "Locmariaquer", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
114 qecb$Site[x] <- "GDMO_Locmariaquer"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
115 } else if (grepl(pattern = "Beg Lann", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
116 qecb$Site[x] <- "GDMO_BegLann"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
117 } else if (grepl(pattern = "Plateau du Four", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
118 qecb$Site[x] <- "FOUR_PlateauFour"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
119 } else if (grepl(pattern = "Grouin", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
120 qecb$Site[x] <- "EGMP_GroinCou"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
121 } else if (grepl(pattern = "Ensembert", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
122 qecb$Site[x] <- "EGMP_PasEmsembert"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
123 } else if (grepl(pattern = "Brée-les-Bains", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
124 qecb$Site[x] <- "EGMP_BreeBains"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
125 } else if (grepl(pattern = "Antiochat", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
126 qecb$Site[x] <- "EGMP_PerreAntiochat"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
127 } else if (grepl(pattern = "Chassiron", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
128 qecb$Site[x] <- "EGMP_Chassiron"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
129 } else if (grepl(pattern = "zone p", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
130 qecb$Site[x] <- "BASQ_FlotsBleusZP"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
131 } else if (grepl(pattern = "zone f", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
132 qecb$Site[x] <- "BASQ_FlotsBleusZF"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
133 } else if (grepl(pattern = "Saint-Michel", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
134 qecb$Site[x] <- "GONB_IlotStMichel"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
135 } else if (grepl(pattern = "Quéménès", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
136 qecb$Site[x] <- "FINS_Quemenes"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
137 } else if (grepl(pattern = "Goulenez", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
138 qecb$Site[x] <- "FINS_SeinGoulenez"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
139 } else if (grepl(pattern = "Kilaourou", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
140 qecb$Site[x] <- "FINS_SeinKilaourou"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
141 } else if (grepl(pattern = "Verdelet", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
142 qecb$Site[x] <- "ARMO_Verdelet"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
143 } else if (grepl(pattern = "Piégu", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
144 qecb$Site[x] <- "ARMO_Piegu"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
145 } else if (grepl(pattern = "Bilfot", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
146 qecb$Site[x] <- "ARMO_Bilfot"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
147 } else if (grepl(pattern = "Plate", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
148 qecb$Site[x] <- "ARMO_IlePlate"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
149 } else if (grepl(pattern = "Perharidy", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
150 qecb$Site[x] <- "PDMO_Perharidy"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
151 } else if (grepl(pattern = "Keraliou", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
152 qecb$Site[x] <- "BRES_Keraliou"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
153 } else if (grepl(pattern = "Mousterlin", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
154 qecb$Site[x] <- "FINS_Mousterlin"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
155 } else if (grepl(pattern = "Nicolas", qecb$Site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
156 qecb$Site[x] <- "FINS_StNicolasGlenan"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
157 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
158 if (grepl(pattern = "Roz", qecb$site[x]) == TRUE) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
159 qecb$Site[x] <- "FINS_AnseRoz"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
160 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
161 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
162
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
163 # Name for report/plot
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
164
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
165 qecb <- tibble::add_column(qecb, Site_bis = qecb$Site, .after = "Site")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
166
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
167 qecb$Site_bis <- ifelse(qecb$Site == "GDMO_Locmariaquer", "Locmariaquer", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
168 qecb$Site_bis <- ifelse(qecb$Site == "GDMO_BegLann", "Beg Lann", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
169 qecb$Site_bis <- ifelse(qecb$Site == "FOUR_PlateauFour", "Plateau du Four", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
170 qecb$Site_bis <- ifelse(qecb$Site == "EGMP_GroinCou", "Groin du Cou", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
171 qecb$Site_bis <- ifelse(qecb$Site == "EGMP_PasEmsembert", "Le Pas d'Emsembert", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
172 qecb$Site_bis <- ifelse(qecb$Site == "EGMP_BreeBains", "La Brée-les-Bains", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
173 qecb$Site_bis <- ifelse(qecb$Site == "EGMP_PerreAntiochat", "Le Perré d'Antiochat", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
174 qecb$Site_bis <- ifelse(qecb$Site == "EGMP_Chassiron", "Chassiron", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
175 qecb$Site_bis <- ifelse(qecb$Site == "BASQ_FlotsBleusZP", "Les Flots Bleus / zone pêcheurs", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
176 qecb$Site_bis <- ifelse(qecb$Site == "BASQ_FlotsBleusZF", "Les Flots Bleus / zone familles", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
177 qecb$Site_bis <- ifelse(qecb$Site == "GONB_IlotStMichel", "Îlot Saint-Michel", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
178 qecb$Site_bis <- ifelse(qecb$Site == "FINS_Quemenes", "Quéménès", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
179 qecb$Site_bis <- ifelse(qecb$Site == "FINS_SeinGoulenez", "Île de Sein - Goulenez", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
180 qecb$Site_bis <- ifelse(qecb$Site == "FINS_SeinKilaourou", "Île de Sein - Kilaourou", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
181 qecb$Site_bis <- ifelse(qecb$Site == "ARMO_Verdelet", "Îlot du Verdelet", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
182 qecb$Site_bis <- ifelse(qecb$Site == "ARMO_Piegu", "Piégu", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
183 qecb$Site_bis <- ifelse(qecb$Site == "ARMO_Bilfot", "Pointe de Bilfot", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
184 qecb$Site_bis <- ifelse(qecb$Site == "ARMO_IlePlate", "Île Plate", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
185 qecb$Site_bis <- ifelse(qecb$Site == "PDMO_Perharidy", "Perharidy", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
186 qecb$Site_bis <- ifelse(qecb$Site == "BRES_Keraliou", "Keraliou", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
187 qecb$Site_bis <- ifelse(qecb$Site == "FINS_Mousterlin", "Pointe de Mousterlin", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
188 qecb$Site_bis <- ifelse(qecb$Site == "FINS_StNicolasGlenan", "Saint-Nicolas des Glénan", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
189 qecb$Site_bis <- ifelse(qecb$Site == "FINS_AnseRoz", "Pointe de l'Anse du Roz", qecb$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
190
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
191 ## change some variables to factor
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
192
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
193 # change 'X..' variables that are indeed % to numeric; https://stackoverflow.com/questions/59410939/apply-function-to-all-variables-with-string-in-name
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
194 ix <- grep("^X..", names(qecb))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
195 qecb[ix] <- lapply(qecb[ix], as.numeric)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
196 rm(ix)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
197
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
198
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
199 ## save the final, complete qecb df_
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
200
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
201 qecb <- qecb[, c(72:107, 1:71)]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
202
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
203 ## qecb df preparation prior qecb calculation
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
204
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
205 # Several issues to solve in the df first
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
206
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
207
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
208 qecb$Type.Bloc <- factor(qecb$Type.Bloc, levels = c("Bloc mobile", "Bloc fixé", "Roche en place"))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
209
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
210 qecb$Face <- factor(qecb$Face, levels = c("face supérieure", "face inférieure"))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
211
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
212 qecb <- dplyr::arrange(qecb, Type.Bloc, Face, Numéro.Bloc.échantillon)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
213
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
214 qecb <- tibble::add_column(qecb, site_year_month_day = paste0(qecb$Site, ".", qecb$Year, ".", qecb$Month, ".", qecb$Day), .after = "Site_bis")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
215
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
216 # save qecb as a new df_ for analysis purpose => several changes to operate to run the code and functions
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
217
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
218 qecbnew <- qecb
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
219
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
220 # df with list object nb and corresponding site_year_month_day value to solve for loop issues
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
221
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
222 df_list_loop <- data.frame("site_year_month_day" = unique(qecbnew$site_year_month_day),
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
223 "loop nb" = c(1:seq_along(unique(qecbnew$site_year_month_day))))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
224
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
225 # dplyr::filter for df that makes problem, then eventually correct in the dataframe for wrong coding; brackets (xx) for nb because will change when qecb df_ enlarged.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
226 # these listed boulder field survey error when highlighted when running the loop, that ran into an error ; it was a step by step procedure with solving one listed observation after another when issues appeared. Surely not the best way to proceed, maybe better just to skip these surveys (site + date), but in the present case I wanted to keep most of the observations, therefore I corrected them manually whenever needed.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
227
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
228 # list nb (28) - EGMP_BreeBains.2016.04.06
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
229 qecbnew$Face <- as.character(qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
230 qecbnew$Face <- ifelse(qecbnew$ID.Fiche == "BDD_IVR&QECB_La Bree_20160406_VImport.xlsx" & qecbnew$Référence.bloc == "avr16-LaBreeB9sup", "face supérieure", qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
231 qecbnew$Face <- ifelse(qecbnew$ID.Fiche == "BDD_IVR&QECB_La Bree_20160406_VImport.xlsx" & qecbnew$Référence.bloc == "avr16-LaBreeB10sup", "face supérieure", qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
232 qecbnew$Face <- as.factor(qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
233
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
234 # list nb 33 - EGMP_PerreAntiochat.2016.04.07
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
235 qecbnew$Face <- as.character(qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
236 qecbnew$Face <- ifelse(qecbnew$ID.Fiche == "BDD_IVR&QECB_PerAnt_20160407_VImport.xlsx" & qecbnew$Référence.bloc == "avr16-PerAntB9sup", "face supérieure", qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
237 qecbnew$Face <- ifelse(qecbnew$ID.Fiche == "BDD_IVR&QECB_PerAnt_20160407_VImport.xlsx" & qecbnew$Référence.bloc == "avr16-PerAntB10sup", "face supérieure", qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
238 qecbnew$Face <- as.factor(qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
239
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
240 # list nb 37 - EGMP_Chassiron.2016.03.09
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
241 qecbnew$Face <- as.character(qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
242 qecbnew$Face <- ifelse(qecbnew$ID.Fiche == "BDD_IVR&QECB_Chassiron_20160309&10_VImport.xlsx" & qecbnew$Référence.bloc == "mars16-ChassB9sup", "face supérieure", qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
243 qecbnew$Face <- ifelse(qecbnew$ID.Fiche == "BDD_IVR&QECB_Chassiron_20160309&10_VImport.xlsx" & qecbnew$Référence.bloc == "mars16-ChasB10sup", "face supérieure", qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
244 qecbnew$Face <- as.factor(qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
245
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
246 # list nb 76 - ARMO_Verdelet.2015.03.23
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
247 qecbnew$Face <- as.character(qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
248 qecbnew$Face <- ifelse(qecbnew$ID.Fiche == "BDD_IVR&QECB_Verdelet_20150323_VImport.xlsx" & qecbnew$Référence.bloc == "mar15-VerB10inf", "face inférieure", qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
249 qecbnew$Face <- as.factor(qecbnew$Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
250
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
251 # list nb 116 - "GDMO_Locmariaquer.2018.09.10"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
252 qecbnew$Type.Bloc <- as.character(qecbnew$Type.Bloc)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
253 qecbnew$Type.Bloc <- ifelse(qecbnew$ID.Fiche == "2018-09-10-GDMO-CDB-001" & qecbnew$Numero.Photo == "2018-09-10_GDMO_01_CDB-5_sup_392578.jpg", "Roche en place", qecbnew$Type.Bloc)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
254 qecbnew$Type.Bloc <- as.factor(qecbnew$Type.Bloc)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
255 qecbnew$quadrat_bis <- ifelse(qecbnew$ID.Fiche == "2018-09-10-GDMO-CDB-001" & qecbnew$Numero.Photo == "2018-09-10_GDMO_01_CDB-5_sup_392578.jpg", "Q5", qecbnew$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
256 qecbnew <- qecbnew %>% dplyr::filter(!(ID.Fiche == "2018-09-10-GDMO-CDB-001" & Numero.Photo == ""))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
257
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
258 # Few sites to remove prior running the for loop because it was not just a encoding mistake for one data, but a globally wroing coding for the site + date survey.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
259
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
260 qecb_i <- qecbnew %>% dplyr::filter(site_year_month_day == "FINS_StNicolasGlenan.2016.04.08") # no bloc fixe !
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
261 qecbnew <- qecbnew %>% dplyr::filter(site_year_month_day != "FINS_StNicolasGlenan.2016.04.08")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
262 qecb_i <- qecbnew %>% dplyr::filter(site_year_month_day == "GDMO_Locmariaquer.2019.09.30") # most faces of blocs mobiles do not correspond to each other; only 3 over 10 boulder have data for both face supérieure and face inférieure
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
263 qecbnew <- qecbnew %>% dplyr::filter(site_year_month_day != "GDMO_Locmariaquer.2019.09.30")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
264 rm(df_list_loop, qecb_i)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
265
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
266
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
267 # check for species with count within sub-0.1m^2-quadrat (i.e. reduced size quadrat compare to most organisms on boulder to count them, because abundant ; then some extrapolation)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
268
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
269 # first for Spirobranchus
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
270
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
271 qecbnew$Nb.Spirobranchus.lamarckii.total.ini <- qecbnew$Nb.Spirobranchus.lamarckii.total
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
272 qecbnew$Nb.Spirobranchus.lamarckii.total <- as.character(qecbnew$Nb.Spirobranchus.lamarckii.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
273
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
274
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
275 qecbnew_spirobranchus <- (dplyr::filter(qecbnew, Nb.Spirobranchus.lamarckii.total %in% c(NA, "NaN", "Inf", "-Inf")))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
276 qecbnew_spirobranchus[, c("Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B")] <- sapply(qecbnew_spirobranchus[, c("Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B")], as.character)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
277 (spirobranchus_data <- subset(qecbnew_spirobranchus, !is.na(qecbnew_spirobranchus$Nb.Spirobranchus.lamarckii.1B) || !is.na(qecbnew_spirobranchus$Nb.Spirobranchus.lamarckii.2B) || !is.na(qecbnew_spirobranchus$Nb.Spirobranchus.lamarckii.3B) || !is.na(qecbnew_spirobranchus$Nb.Spirobranchus.lamarckii.4B) || !is.na(qecbnew_spirobranchus$Nb.Spirobranchus.lamarckii.5B))[, c("site_year_month_day", "Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B", "Nb.Spirobranchus.lamarckii.total")])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
278
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
279 quemenes <- dplyr::filter(qecbnew, Site == "FINS_Quemenes")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
280 quemenes <- dplyr::arrange(quemenes, date_fiche)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
281 # for Quemenes, issue because for sampling date "FINS_Quemenes.2015.09.30" the 5 counts of Spirobranchus were encoded in 1B instead of total !!! I noticed this issue when mining data (see below), therefore I corrected before running below script for Spirobranchus.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
282 qecbnew$Nb.Spirobranchus.lamarckii.total <- ifelse(qecbnew$site_year_month_day == "FINS_Quemenes.2015.09.30" & is.na(qecbnew$Nb.Spirobranchus.lamarckii.total), qecbnew$Nb.Spirobranchus.lamarckii.1B, qecbnew$Nb.Spirobranchus.lamarckii.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
283
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
284 (quemenes <- dplyr::filter(qecbnew, site_year_month_day == "FINS_Quemenes.2015.09.30")[, c("site_year_month_day", "Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B", "Nb.Spirobranchus.lamarckii.total")])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
285 rm(quemenes)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
286
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
287 seinkilaourou <- dplyr::filter(qecbnew, Site == "FINS_SeinKilaourou")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
288 seinkilaourou <- dplyr::arrange(seinkilaourou, date_fiche)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
289 # same issue with SeinKilaourou
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
290 qecbnew$Nb.Spirobranchus.lamarckii.total <- ifelse(qecbnew$site_year_month_day == "FINS_SeinKilaourou.2015.04.21" & is.na(qecbnew$Nb.Spirobranchus.lamarckii.total), qecbnew$Nb.Spirobranchus.lamarckii.1B, qecbnew$Nb.Spirobranchus.lamarckii.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
291 (seinkilaourou <- dplyr::filter(qecbnew, site_year_month_day == "FINS_SeinKilaourou.2015.04.21")[, c("site_year_month_day", "Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B", "Nb.Spirobranchus.lamarckii.total")])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
292 rm(seinkilaourou)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
293
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
294 # some more issues however with "x100"count data
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
295 spirobranchus <- subset(qecbnew, !is.na(qecbnew$Nb.Spirobranchus.lamarckii.1B) & !is.na(qecbnew$Nb.Spirobranchus.lamarckii.2B) & !is.na(qecbnew$Nb.Spirobranchus.lamarckii.3B) & !is.na(qecbnew$Nb.Spirobranchus.lamarckii.4B) & !is.na(qecbnew$Nb.Spirobranchus.lamarckii.5B) & !is.na(qecbnew$Nb.Spirobranchus.lamarckii.total))[, c("site_year_month_day", "Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B", "Nb.Spirobranchus.lamarckii.total")]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
296
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
297 for (i in c(1:nrow(spirobranchus))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
298 spirobranchus$mean.x.100[[i]] <- sum(spirobranchus[i, c(2:6)], na.rm = TRUE) / sum(!is.na(spirobranchus[i, c(2:6)])) * 100
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
299 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
300
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
301 spirobranchus$mean.x.100 <- unlist(spirobranchus$mean.x.100)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
302 spirobranchus$Nb.Spirobranchus.lamarckii.total <- as.numeric(spirobranchus$Nb.Spirobranchus.lamarckii.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
303 for (i in c(1:nrow(spirobranchus))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
304 spirobranchus$diff[[i]] <- spirobranchus[i, "Nb.Spirobranchus.lamarckii.total"] - spirobranchus[i, "mean.x.100"]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
305 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
306
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
307 spirobranchus$diff <- abs(as.integer(spirobranchus$diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
308 spirobranchus <- dplyr::arrange(spirobranchus, desc(diff), mean.x.100)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
309 spirobranchus <- dplyr::arrange(dplyr::filter(spirobranchus, diff != 0 & mean.x.100 != 0), desc(diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
310
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
311 # check it all in the qecbnew df
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
312
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
313 for (i in c(1:nrow(qecbnew))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
314 qecbnew$mean.x.100[[i]] <-
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
315 sum(qecbnew[i, c("Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B")], na.rm = TRUE) / sum(!is.na(qecbnew[i, c("Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B")])) * 100
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
316 } # sum of only NAs/0 = NaN; so replace NaN by Na
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
317 qecbnew$mean.x.100 <- as.character(qecbnew$mean.x.100)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
318
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
319
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
320 for (i in c(1:nrow(qecbnew))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
321 qecbnew$mean.x.100[[i]] <- ifelse(qecbnew$mean.x.100[[i]] == "NaN", NA, qecbnew$mean.x.100[[i]])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
322 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
323 qecbnew$mean.x.100 <- as.integer(qecbnew$mean.x.100)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
324
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
325 qecbnew$Nb.Spirobranchus.lamarckii.total <- as.integer(qecbnew$Nb.Spirobranchus.lamarckii.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
326 qecbnew$Nb.Spirobranchus.lamarckii.total.diff <- abs((qecbnew$Nb.Spirobranchus.lamarckii.total - qecbnew$mean.x.100))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
327 spirobranchus_diff <- qecbnew[, c("Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B", "Nb.Spirobranchus.lamarckii.total", "Nb.Spirobranchus.lamarckii.total.ini", "mean.x.100", "Nb.Spirobranchus.lamarckii.total.diff")]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
328 spirobranchus_diff <- dplyr::arrange(spirobranchus_diff, desc(Nb.Spirobranchus.lamarckii.total.diff), mean.x.100)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
329 spirobranchus_diff <- dplyr::arrange(dplyr::filter(spirobranchus_diff, Nb.Spirobranchus.lamarckii.total.diff != 0 & mean.x.100 != 0), desc(Nb.Spirobranchus.lamarckii.total.diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
330
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
331 qecbnew$Nb.Spirobranchus.lamarckii.total <- ifelse(qecbnew$Nb.Spirobranchus.lamarckii.total.diff != 0 & qecbnew$mean.x.100 != 0, qecbnew$mean.x.100, qecbnew$Nb.Spirobranchus.lamarckii.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
332 spirobranchus_diff <- qecbnew[, c("Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B", "Nb.Spirobranchus.lamarckii.total", "Nb.Spirobranchus.lamarckii.total.ini", "mean.x.100", "Nb.Spirobranchus.lamarckii.total.diff")]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
333 spirobranchus_diff$Nb.Spirobranchus.lamarckii.total.diff <- abs(as.integer(spirobranchus_diff$Nb.Spirobranchus.lamarckii.total.diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
334 spirobranchus_diff <- dplyr::arrange(spirobranchus_diff, desc(Nb.Spirobranchus.lamarckii.total.diff), mean.x.100)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
335 spirobranchus_diff <- dplyr::arrange(dplyr::filter(spirobranchus_diff, Nb.Spirobranchus.lamarckii.total.diff != 0 & mean.x.100 != 0), desc(Nb.Spirobranchus.lamarckii.total.diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
336 # ok, change made when data x 100 was not correct.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
337
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
338 # finally, change NA by mean.x100 for Spirobranchus total
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
339 qecbnew$Nb.Spirobranchus.lamarckii.total <- as.character(qecbnew$Nb.Spirobranchus.lamarckii.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
340 for (i in c(1:nrow(qecbnew))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
341 qecbnew$Nb.Spirobranchus.lamarckii.total[[i]] <- ifelse(qecbnew$Nb.Spirobranchus.lamarckii.total[[i]] %in% c(NA, "NaN", "Inf", "-Inf"), sum(qecbnew[i, c("Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B")], na.rm = TRUE) / sum(!is.na(qecbnew[i, c("Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B")])) * 100, qecbnew$Nb.Spirobranchus.lamarckii.total[[i]])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
342 } # sum of only NAs/0 = NaN; so replace NaN by Na
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
343
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
344
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
345 for (i in c(1:nrow(qecbnew))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
346 qecbnew$Nb.Spirobranchus.lamarckii.total[[i]] <- ifelse(qecbnew$Nb.Spirobranchus.lamarckii.total[[i]] == "NaN", NA, qecbnew$Nb.Spirobranchus.lamarckii.total[[i]])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
347 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
348
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
349 qecbnew$Nb.Spirobranchus.lamarckii.total <- as.integer(qecbnew$Nb.Spirobranchus.lamarckii.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
350
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
351 qecbnew$Nb.Spirobranchus.lamarckii.total.diff <- abs(qecbnew$Nb.Spirobranchus.lamarckii.total - qecbnew$Nb.Spirobranchus.lamarckii.total.ini)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
352 spirobranchus_diff <- qecbnew[, c("Nb.Spirobranchus.lamarckii.1B", "Nb.Spirobranchus.lamarckii.2B", "Nb.Spirobranchus.lamarckii.3B", "Nb.Spirobranchus.lamarckii.4B", "Nb.Spirobranchus.lamarckii.5B", "Nb.Spirobranchus.lamarckii.total", "Nb.Spirobranchus.lamarckii.total.ini", "mean.x.100", "Nb.Spirobranchus.lamarckii.total.diff")]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
353 spirobranchus_diff <- dplyr::arrange(spirobranchus_diff, desc(Nb.Spirobranchus.lamarckii.total.diff), mean.x.100)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
354 spirobranchus_diff <- dplyr::arrange(dplyr::filter(spirobranchus_diff, Nb.Spirobranchus.lamarckii.total.diff != 0 & mean.x.100 != 0), desc(Nb.Spirobranchus.lamarckii.total.diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
355
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
356 qecbnew <- subset(qecbnew, select = -c(Nb.Spirobranchus.lamarckii.total.ini, mean.x.100, Nb.Spirobranchus.lamarckii.total.diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
357
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
358 rm(qecbnew_spirobranchus, spirobranchus, spirobranchus_data, spirobranchus_diff)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
359
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
360 # do the same for spirorbis
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
361
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
362 qecbnew$Nb.spirorbis.total.ini <- qecbnew$Nb.spirorbis.total
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
363 qecbnew$Nb.spirorbis.total <- as.character(qecbnew$Nb.spirorbis.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
364
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
365 qecbnew_spirorbis <- (dplyr::filter(qecbnew, Nb.spirorbis.total %in% c(NA, "NaN", "Inf", "-Inf")))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
366 qecbnew_spirorbis[, c("Nb.spirorbis.1A", "Nb.spirorbis.2A", "Nb.spirorbis.3A", "Nb.spirorbis.4A", "Nb.spirorbis.5A")] <- sapply(qecbnew_spirorbis[, c("Nb.spirorbis.1A", "Nb.spirorbis.2A", "Nb.spirorbis.3A", "Nb.spirorbis.4A", "Nb.spirorbis.5A")], as.character)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
367 (spirobranchus_data <- subset(qecbnew_spirorbis, !is.na(qecbnew_spirorbis$Nb.spirorbis.1A) || !is.na(qecbnew_spirorbis$Nb.spirorbis.2A) || !is.na(qecbnew_spirorbis$Nb.spirorbis.3A) || !is.na(qecbnew_spirorbis$Nb.spirorbis.4A) || !is.na(qecbnew_spirorbis$Nb.spirorbis.5A))[, c("site_year_month_day", "Nb.spirorbis.1A", "Nb.spirorbis.2A", "Nb.spirorbis.3A", "Nb.spirorbis.4A", "Nb.spirorbis.5A", "Nb.spirorbis.total")])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
368
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
369 # In contrast to Spirobranchus data, no encoding issues for spirorbis data, cfr when sub-quadrat 1A-5A are ALL encoded, NA for total.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
370
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
371 # some more issues however with "x200"count data
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
372
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
373 spirorbis <- subset(qecbnew, !is.na(qecbnew$Nb.spirorbis.1A) & !is.na(qecbnew$Nb.spirorbis.2A) & !is.na(qecbnew$Nb.spirorbis.3A) & !is.na(qecbnew$Nb.spirorbis.4A) & !is.na(qecbnew$Nb.spirorbis.5A) & !is.na(qecbnew$Nb.spirorbis.total))[, c("site_year_month_day", "Nb.spirorbis.1A", "Nb.spirorbis.2A", "Nb.spirorbis.3A", "Nb.spirorbis.4A", "Nb.spirorbis.5A", "Nb.spirorbis.total")]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
374 for (i in c(1:nrow(spirorbis))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
375 spirorbis$mean.x.200[[i]] <- sum(spirorbis[i, c(2:6)], na.rm = TRUE) / sum(!is.na(spirorbis[i, c(2:6)])) * 200
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
376 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
377 spirorbis$mean.x.200 <- unlist(spirorbis$mean.x.200)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
378 spirorbis$Nb.spirorbis.total <- as.numeric(spirorbis$Nb.spirorbis.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
379 for (i in c(1:nrow(spirorbis))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
380 spirorbis$diff[[i]] <- spirorbis[i, "Nb.spirorbis.total"] - spirorbis[i, "mean.x.200"]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
381 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
382 spirorbis$diff <- abs(as.integer(spirorbis$diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
383 spirorbis <- dplyr::arrange(spirorbis, desc(diff), mean.x.200)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
384 (gonb_ilotstmichel_2015_04_18 <- dplyr::filter(spirorbis, site_year_month_day == "GONB_IlotStMichel.2015.04.18"))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
385 rm(gonb_ilotstmichel_2015_04_18)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
386 spirorbis <- dplyr::arrange(dplyr::filter(spirorbis, diff != 0 & mean.x.200 != 0), desc(diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
387
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
388 # check it all in the qecbnew df
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
389
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
390 for (i in c(1:nrow(qecbnew))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
391 qecbnew$mean.x.200[[i]] <- sum(qecbnew[i, c("Nb.spirorbis.1A", "Nb.spirorbis.2A", "Nb.spirorbis.3A", "Nb.spirorbis.4A", "Nb.spirorbis.5A")], na.rm = TRUE) / sum(!is.na(qecbnew[i, c("Nb.spirorbis.1A", "Nb.spirorbis.2A", "Nb.spirorbis.3A", "Nb.spirorbis.4A", "Nb.spirorbis.5A")])) * 200
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
392 } # sum of only NAs/0 = NaN; so replace NaN by Na
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
393 qecbnew$mean.x.200 <- as.character(qecbnew$mean.x.200)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
394
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
395 for (i in c(1:nrow(qecbnew))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
396 qecbnew$mean.x.200[[i]] <- ifelse(qecbnew$mean.x.200[[i]] == "NaN", NA, qecbnew$mean.x.200[[i]])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
397 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
398
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
399 qecbnew$mean.x.200 <- as.integer(qecbnew$mean.x.200)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
400
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
401 qecbnew$Nb.spirorbis.total <- as.integer(qecbnew$Nb.spirorbis.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
402 qecbnew$Nb.spirorbis.total.diff <- abs((qecbnew$Nb.spirorbis.total - qecbnew$mean.x.200))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
403 spirorbis_diff <- qecbnew[, c("Nb.spirorbis.1A", "Nb.spirorbis.2A", "Nb.spirorbis.3A", "Nb.spirorbis.4A", "Nb.spirorbis.5A", "Nb.spirorbis.total", "Nb.spirorbis.total.ini", "mean.x.200", "Nb.spirorbis.total.diff")]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
404 spirorbis_diff <- dplyr::arrange(spirorbis_diff, desc(Nb.spirorbis.total.diff), mean.x.200)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
405 spirorbis_diff <- dplyr::arrange(dplyr::filter(spirorbis_diff, Nb.spirorbis.total.diff != 0 & mean.x.200 != 0), desc(Nb.spirorbis.total.diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
406
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
407 qecbnew$Nb.spirorbis.total <- ifelse(qecbnew$Nb.spirorbis.total.diff != 0 & qecbnew$mean.x.200 != 0, qecbnew$mean.x.200, qecbnew$Nb.spirorbis.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
408 spirorbis_diff <- qecbnew[, c("Nb.spirorbis.1A", "Nb.spirorbis.2A", "Nb.spirorbis.3A", "Nb.spirorbis.4A", "Nb.spirorbis.5A", "Nb.spirorbis.total", "Nb.spirorbis.total.ini", "mean.x.200", "Nb.spirorbis.total.diff")]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
409 spirorbis_diff$Nb.spirorbis.total.diff <- abs(as.integer(spirorbis_diff$Nb.spirorbis.total.diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
410 spirorbis_diff <- dplyr::arrange(spirorbis_diff, desc(Nb.spirorbis.total.diff), mean.x.200)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
411 spirorbis_diff <- dplyr::arrange(dplyr::filter(spirorbis_diff, Nb.spirorbis.total.diff != 0 & mean.x.200 != 0), desc(Nb.spirorbis.total.diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
412 # ok, change made when data x 200 was not correct.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
413
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
414 # finally, change NA by mean.x200 for spirorbis total
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
415 qecbnew$Nb.spirorbis.total <- as.character(qecbnew$Nb.spirorbis.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
416 for (i in c(1:nrow(qecbnew))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
417 qecbnew$Nb.spirorbis.total[[i]] <- ifelse(qecbnew$Nb.spirorbis.total[[i]] %in% c(NA, "NaN", "Inf", "-Inf"), sum(qecbnew[i, c("Nb.spirorbis.1A", "Nb.spirorbis.2A", "Nb.spirorbis.3A", "Nb.spirorbis.4A", "Nb.spirorbis.5A")], na.rm = TRUE) / sum(!is.na(qecbnew[i, c("Nb.spirorbis.1A", "Nb.spirorbis.2A", "Nb.spirorbis.3A", "Nb.spirorbis.4A", "Nb.spirorbis.5A")])) * 200, qecbnew$Nb.spirorbis.total[[i]])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
418 } # sum of only NAs/0 = NaN; so replace NaN by Na
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
419
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
420 for (i in c(1:nrow(qecbnew))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
421 qecbnew$Nb.spirorbis.total[[i]] <- ifelse(qecbnew$Nb.spirorbis.total[[i]] == "NaN", NA, qecbnew$Nb.spirorbis.total[[i]])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
422 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
423
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
424 qecbnew$Nb.spirorbis.total <- as.integer(qecbnew$Nb.spirorbis.total)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
425
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
426 qecbnew$Nb.spirorbis.total.diff <- abs(qecbnew$Nb.spirorbis.total - qecbnew$Nb.spirorbis.total.ini)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
427 spirorbis_diff <- qecbnew[, c("Nb.spirorbis.1A", "Nb.spirorbis.2A", "Nb.spirorbis.3A", "Nb.spirorbis.4A", "Nb.spirorbis.5A", "Nb.spirorbis.total", "Nb.spirorbis.total.ini", "mean.x.200", "Nb.spirorbis.total.diff")]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
428 spirorbis_diff <- dplyr::arrange(spirorbis_diff, desc(Nb.spirorbis.total.diff), mean.x.200)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
429 spirorbis_diff <- dplyr::arrange(dplyr::filter(spirorbis_diff, Nb.spirorbis.total.diff != 0 & mean.x.200 != 0), desc(Nb.spirorbis.total.diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
430
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
431 qecbnew <- subset(qecbnew, select = -c(Nb.spirorbis.total.ini, mean.x.200, Nb.spirorbis.total.diff))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
432
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
433 rm(qecbnew_spirorbis, spirorbis, spirobranchus_data, spirorbis_diff, i)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
434
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
435
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
436 # dplyr::filter for abnormal data, based on histogram distribution of data
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
437
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
438 dplyr::filter(qecbnew, X..algues.brunes > 100)[, c("Site", "date_fiche", "Type.Bloc", "Numéro.Bloc.échantillon", "Face", "X..algues.brunes")]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
439 qecbnew$X..algues.brunes <- ifelse(qecbnew$X..algues.brunes > 100, 100, qecbnew$X..algues.brunes)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
440 dplyr::filter(qecbnew, X..algues.rouges > 100)[, c("Site", "date_fiche", "Type.Bloc", "Numéro.Bloc.échantillon", "Face", "X..algues.rouges")]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
441 qecbnew$X..algues.rouges <- ifelse(qecbnew$X..algues.rouges > 100, 100, qecbnew$X..algues.rouges)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
442
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
443
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
444 ## SCRIPT I - NAs <- 0 ; cfr previous comment makes no sense to have NA encoded when the presence of an organism is in reality = 0
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
445
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
446 # We are facing an issues with NA observations, because either they were not measured/counted, then they are effectively NAs; or these NAs = indeed "0"; but I cannot have NAs for variables that are included in the index determination, cfr if 5+0 = 5, 5+NA = NA; see for example site_year_month_day == "ARMO_Bilfot.2014.04.28", Nb.Spirobranchus.lamarckii.total is NA ...
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
447 # I theregore change these NAs by 0
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
448
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
449 # replace NAs by "0" for variables used in qecb determination
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
450 qecbnew[, c("X..algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
451 "X..algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
452 "X..Lithophyllum",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
453 "X..Cladophora",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
454 "Nb.Littorina.obtusata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
455 "Nb.Gibbula.cineraria",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
456 "Nb.Gibbula.pennanti",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
457 "Nb.Gibbula.umbilicalis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
458 "X..Eponges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
459 "X..Ascidies.Coloniales",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
460 "X..Ascidies.Solitaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
461 "X..Bryozoaires.Dresses",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
462 "X..algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
463 "X..Roche.Nue",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
464 "Nb.spirorbis.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
465 "X..Balanes.Vivantes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
466 "Nb.Spirobranchus.lamarckii.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
467 "X..Surface.Accolement")] <- lapply(qecbnew[,
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
468 c("X..algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
469 "X..algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
470 "X..Lithophyllum",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
471 "X..Cladophora",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
472 "Nb.Littorina.obtusata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
473 "Nb.Gibbula.cineraria",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
474 "Nb.Gibbula.pennanti",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
475 "Nb.Gibbula.umbilicalis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
476 "X..Eponges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
477 "X..Ascidies.Coloniales",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
478 "X..Ascidies.Solitaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
479 "X..Bryozoaires.Dresses",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
480 "X..algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
481 "X..Roche.Nue",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
482 "Nb.spirorbis.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
483 "X..Balanes.Vivantes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
484 "Nb.Spirobranchus.lamarckii.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
485 "X..Surface.Accolement")],
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
486 function(x) replace(x, is.na(x), 0))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
487
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
488 # and also replace NA for bivalve by 0 for EGMP and BASQ surveys cfr for accollement correction later on.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
489
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
490 qecbnew$X..Mytilus.sp. <- ifelse((substr(qecbnew$Site, 1, 4) %in% c("EGMP", "BASQ")) & is.na(qecbnew$X..Mytilus.sp.), 0, qecbnew$X..Mytilus.sp.)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
491 qecbnew$Nb.Crassostrea.gigas <- ifelse((substr(qecbnew$Site, 1, 4) %in% c("EGMP", "BASQ")) & is.na(qecbnew$Nb.Crassostrea.gigas), 0, qecbnew$Nb.Crassostrea.gigas)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
492 qecbnew$Nb.Ostrea.edulis <- ifelse((substr(qecbnew$Site, 1, 4) %in% c("EGMP", "BASQ")) & is.na(qecbnew$Nb.Ostrea.edulis), 0, qecbnew$Nb.Ostrea.edulis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
493
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
494
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
495 # add a region variable
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
496 region <- rep(NA, nrow(qecbnew))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
497 qecbnew <- tibble::add_column(qecbnew, region, .after = "Site_bis")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
498 qecbnew$region <- ifelse(qecbnew$Site %in% c("EGMP_GroinCou", "EGMP_PasEmsembert", "EGMP_BreeBains", "EGMP_PerreAntiochat", "EGMP_Chassiron", "BASQ_FlotsBleusZP", "BASQ_FlotsBleusZF"), "EGMP.BASQ", "Bretagne")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
499 rm(region)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
500 qecbnew <- dplyr::arrange(qecbnew, region, site_year_month_day, Type.Bloc, Numéro.Bloc.échantillon, Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
501
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
502 # accolement function according to recent 'retournement'
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
503
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
504 ## before I go further ahead, I have to correct for surface d'accollement for several variable for BM.FI !!
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
505
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
506 # not the same file name between script qecb script (qecbNew) and this script (qecbNew); doesn't matter, only appears here in the first dplyr::filter lines.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
507
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
508 qecbnew <- tibble::add_column(qecbnew, terri_ = substr(qecbnew$Site, 1, 4), .after = "Site_bis")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
509
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
510 qecbnew$X..Eponges_ini <- qecbnew$X..Eponges
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
511 qecbnew$X..Ascidies.Coloniales_ini <- qecbnew$X..Ascidies.Coloniales
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
512 qecbnew$X..Ascidies.Solitaires_ini <- qecbnew$X..Ascidies.Solitaires
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
513 qecbnew$X..Bryozoaires.Dresses_ini <- qecbnew$X..Bryozoaires.Dresses
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
514 qecbnew$X..Lithophyllum_ini <- qecbnew$X..Lithophyllum
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
515 qecbnew$X..Balanes.Vivantes_ini <- qecbnew$X..Balanes.Vivantes
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
516
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
517 df_bm_fs <- qecbnew %>% dplyr::filter(Type.Bloc == "Bloc mobile" & Face == "face supérieure")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
518 df_bm_fi <- qecbnew %>% dplyr::filter(Type.Bloc == "Bloc mobile" & Face == "face inférieure")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
519 df_bf <- qecbnew %>% dplyr::filter(Type.Bloc != "Bloc mobile")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
520
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
521 `%notin%` <- Negate(`%in%`)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
522
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
523 acco_fct <- function(var_) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
524
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
525 df_bm_fi$var_cor.acco. <<- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
526
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
527 for (i in c(1:nrow(df_bm_fi))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
528
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
529 df_bm_fi$var_cor.acco.[[i]] <<- if (df_bm_fi$terri_[[i]] %notin% c("EGMP", "BASQ")) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
530 ifelse(#df_$Couleur.dominante %in% c("Rouge", "Brune", "Brune-Rouge") ||
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
531 df_bm_fs$Couleur.dominante[[i]] %in% c("Blanche", "Verte", "Blanche-Verte", "Colorée"), df_bm_fi[i, var_] / (100 - df_bm_fi$X..Surface.Accolement[[i]]) * 100, df_bm_fi[i, var_])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
532 } else {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
533 ifelse(df_bm_fs$Couleur.dominante[[i]] %in% c("Blanche", "Verte", "Blanche-Verte", "Colorée")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
534 & df_bm_fi$X..Surface.Accolement[[i]] != 0 # I have to use it in dplyr::filter this time as well for EGMP- BASQ (but not for Bretagne, although could be added, same result); identical/repeated measure for BM.FI and BM.FS
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
535 & df_bm_fs$X..Mytilus.sp.[[i]] == 0, df_bm_fi[i, var_] / (100 - df_bm_fi$X..Surface.Accolement[[i]]) * 100, df_bm_fi[i, var_])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
536 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
537
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
538 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
539
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
540 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
541
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
542 # I would only consider colors in c("Rouge", "Brune", "Brune-Rouge") for BM.FI correction [ and not the series c("Blanche-Brune", "Rouge", "Brune", "Blanche-Rouge", "Brune-Rouge", "Rouge-Verte", "Brune-Verte") ] ; and for BM.FS, the list c("Blanche", "Verte", "Colorée") => we do the correction for BM.FI accollement based on BM.FS color !!!
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
543
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
544
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
545 # apply acco_fct to BM.FI variables
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
546
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
547 apply_acco_fct <- function(var_) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
548
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
549 show(sort(df_bm_fi[, var_], decreasing = TRUE, index.return = FALSE)[1:50])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
550 pre_ <- as.vector(df_bm_fi[, var_])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
551 acco_fct(var_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
552 df_bm_fi <<- tibble::add_column(df_bm_fi, var_cor. = df_bm_fi$var_cor.acco., .after = var_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
553 show(sort(df_bm_fi$var_cor., decreasing = TRUE, index.return = FALSE)[1:50])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
554 df_bm_fi$var_cor. <<- as.numeric(ifelse(as.character(df_bm_fi$var_cor.) %in% c(NA, "NaN", "-Inf", "Inf"), "0", as.character(df_bm_fi$var_cor.)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
555 df_bm_fi$var_cor. <<- ifelse(df_bm_fi$var_cor. > 100, 100, df_bm_fi$var_cor.)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
556 show(sort(df_bm_fi$var_cor., decreasing = TRUE, index.return = FALSE)[1:50])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
557 show(length(na.omit(which(abs(as.vector(df_bm_fi$var_cor.) - pre_) != 0))) / na.omit(length(df_bm_fi$var_cor.)) * 100)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
558 par(mfrow = c(1, 3))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
559 hist(pre_, main = var_, xlab = "pre-corection")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
560 hist(df_bm_fi$var_cor., main = var_, xlab = "post-corection")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
561 hist(df_bm_fi[as.vector(which(abs(as.vector(df_bm_fi$var_cor.) - pre_) != 0)), var_], main = var_, xlab = "diff. post-pre != 0")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
562 par(mfrow = c(1, 1))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
563 df_bm_fi <<- df_bm_fi[, -which(names(df_bm_fi) %in% c(var_, "var_cor.acco."))]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
564 colnames(df_bm_fi)[colnames(df_bm_fi) == "var_cor."] <<- var_
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
565
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
566 rm(pre_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
567
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
568 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
569
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
570 apply_acco_fct("X..Eponges")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
571 apply_acco_fct("X..Ascidies.Coloniales")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
572 apply_acco_fct("X..Ascidies.Solitaires")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
573 apply_acco_fct("X..Bryozoaires.Dresses")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
574 apply_acco_fct("X..Lithophyllum")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
575 apply_acco_fct("X..Balanes.Vivantes")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
576
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
577 qecbnew <- dplyr::bind_rows(df_bm_fs, df_bm_fi)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
578 qecbnew <- dplyr::bind_rows(qecbnew, df_bf)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
579
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
580 qecbnew <- dplyr::arrange(qecbnew, region, site_year_month_day, Type.Bloc, Numéro.Bloc.échantillon, Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
581
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
582 # do remove some more data ...
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
583 # "FINS_Quemenes.2020.10.16", bad encoding, I let know Anna Capietto to make changes => was corrected normally, so unactivate next time I download ESTAMP data
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
584 qecbnew <- dplyr::filter(qecbnew, site_year_month_day != "FINS_Quemenes.2020.10.16")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
585
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
586 # save the final qecbnew df_
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
587
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
588 qecb <- qecbnew
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
589
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
590
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
591 `%notin%` <- Negate(`%in%`)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
592
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
593 ## reorder and/or create new variables
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
594
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
595 # variable site_year_month_day moved for clarity purpose, not needed necessarily
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
596 qecb <- tibble::add_column(qecb, qecb$site_year_month_day, .after = "Site_bis")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
597 qecb <- qecb[, -which(names(qecb) %in% c("site_year_month_day"))]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
598 qecb <- dplyr::rename(qecb, site_year_month_day = `qecb$site_year_month_day`)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
599
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
600 # new variable period (nothing to see with the existing périod variable)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
601 period <- rep(NA, nrow(qecb))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
602 qecb <- tibble::add_column(qecb, period, .after = "Day")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
603 qecb$period <- ifelse(as.numeric(qecb$Month) < 7, "p1", "p2")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
604 qecb$period <- as.factor(qecb$period)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
605 rm(period)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
606
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
607 qecb <- dplyr::arrange(qecb, region, site_year_month_day, Type.Bloc, Numéro.Bloc.échantillon, Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
608
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
609 # NB: les infos surface d'accolement sont dupliquées de la face inf vers la face sup de blocs mobiles (même si peu de sens d'avoir cette info pour les face sup ...)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
610 # NB: les data "Abondance ressources ciblées par pêcheurs à pied" présentes uniquement pour les blocs mobiles sont dupliquées entre face inf et face sup.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
611
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
612 ## SCRIPT I - NAs <- 0
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
613
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
614 # already performed for part in the CB_qecb script ; but here I also consider mobile organisms, logical observation (or not) according to boulders, faces etc ... so more complete. Could be some kind of script fusion to only keep Na to 0 correction in one script, i.e. moving this script to the CB_qecb script ...
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
615
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
616 bretagne_bm <- dplyr::filter(qecb, region == "Bretagne" & Type.Bloc == "Bloc mobile")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
617 bretagne_bf <- dplyr::filter(qecb, region == "Bretagne" & Type.Bloc %in% c("Bloc fixé", "Roche en place"))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
618 egmp_basq_bm <- dplyr::filter(qecb, region == "EGMP.BASQ" & Type.Bloc == "Bloc mobile")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
619 egmp_basq_bf <- dplyr::filter(qecb, region == "EGMP.BASQ" & Type.Bloc %in% c("Bloc fixé", "Roche en place"))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
620
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
621 # replace NAs by "0" for variables used in qecb determination
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
622
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
623 bretagne_bm[, c(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
624 "X..algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
625 "Strate.algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
626 "X..algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
627 "Strate.algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
628 "X..algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
629 "Strate.algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
630 "X..Cladophora",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
631 "X..Lithophyllum",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
632 "X..Recouvrement.Sediment", # is NA, then replace by 0 as well because no sense to have a NA value for "% recouvrement sédiment" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
633 #"Type.Sediment",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
634 "X..Roche.Nue", # is NA, then replace by 0 as well because no sense to have a NA value for "% roche nue" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
635 "Nb.Littorina.obtusata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
636 "Nb.Gibbula.cineraria",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
637 "Nb.Gibbula.pennanti",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
638 "Nb.Gibbula.umbilicalis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
639 "Nb.Phallusia.mamillata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
640 "Nb.Tethya.aurantium",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
641 #"Nb.Spirobranchus.lamarckii.1B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
642 #"Nb.Spirobranchus.lamarckii.2B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
643 #"Nb.Spirobranchus.lamarckii.3B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
644 #"Nb.Spirobranchus.lamarckii.4B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
645 #"Nb.Spirobranchus.lamarckii.5B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
646 "Nb.Spirobranchus.lamarckii.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
647 #"Nb.spirorbis.1A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
648 #"Nb.spirorbis.2A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
649 #"Nb.spirorbis.3A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
650 #"Nb.spirorbis.4A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
651 #"Nb.spirorbis.5A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
652 "Nb.spirorbis.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
653 #.."Nb.Crassostrea.gigas",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
654 #.."Nb.Ostrea.edulis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
655 #.."X..Mytilus.sp.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
656 #.."X..Hermelles",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
657 #.."X..Hydraires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
658 "X..Eponges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
659 "X..Ascidies.Coloniales",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
660 "X..Ascidies.Solitaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
661 "X..Bryozoaires.Dresses",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
662 "X..Balanes.Vivantes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
663 #"Commentaires.Avant",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
664 "X..Surface.Accolement", # is NA, then replace by 0 as well because no sense to have a NA value for "% surface accolement" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
665 #"Type.sustrat.observé",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
666 #"Commentaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
667 "Nb.Cancer.pagurus..Tourteau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
668 "Nb.Necora.puber..Etrille.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
669 "Nb.Carcinus.maenas..Crabe.vert.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
670 "Nb.Nucella.lapilus..Pourpre.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
671 #.."Nb.Eriphia.verrucosa..Crabe.verruqueux.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
672 #.."Nb.Octopus.vulgaris..Poulpe.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
673 "Nb.Galathea..Galathées.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
674 #.."Nb.Paracentrotus.lividus..Oursin.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
675 "Nb.Lophozozymus.incisus..ancien.Xantho.incisus.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
676 "Nb.Palaemon.sp..Crevette.bouquet.ou.crevette.rose.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
677 "Nb.Haliotis.tuberculata..Ormeau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
678 #"Nb.Stramonita.haemastoma..Pourpre.bouche.de.sang.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
679 "Nb.Littorina.littorea..Bigorneau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
680 "Nb.Xantho.pilipes..Xanthe.poilu.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
681 "Nb.Mimachlamys.varia..Pétoncle.noir."
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
682 )
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
683 ] <- lapply(bretagne_bm[, c(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
684 "X..algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
685 "Strate.algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
686 "X..algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
687 "Strate.algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
688 "X..algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
689 "Strate.algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
690 "X..Cladophora",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
691 "X..Lithophyllum",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
692 "X..Recouvrement.Sediment", # is NA, then replace by 0 as well because no sense to have a NA value for "% recouvrement sédiment" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
693 #"Type.Sediment",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
694 "X..Roche.Nue", # is NA, then replace by 0 as well because no sense to have a NA value for "% roche nue" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
695 "Nb.Littorina.obtusata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
696 "Nb.Gibbula.cineraria",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
697 "Nb.Gibbula.pennanti",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
698 "Nb.Gibbula.umbilicalis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
699 "Nb.Phallusia.mamillata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
700 "Nb.Tethya.aurantium",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
701 #"Nb.Spirobranchus.lamarckii.1B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
702 #"Nb.Spirobranchus.lamarckii.2B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
703 #"Nb.Spirobranchus.lamarckii.3B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
704 #"Nb.Spirobranchus.lamarckii.4B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
705 #"Nb.Spirobranchus.lamarckii.5B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
706 "Nb.Spirobranchus.lamarckii.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
707 #"Nb.spirorbis.1A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
708 #"Nb.spirorbis.2A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
709 #"Nb.spirorbis.3A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
710 #"Nb.spirorbis.4A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
711 #"Nb.spirorbis.5A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
712 "Nb.spirorbis.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
713 #.."Nb.Crassostrea.gigas",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
714 #.."Nb.Ostrea.edulis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
715 #.."X..Mytilus.sp.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
716 #.."X..Hermelles",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
717 #.."X..Hydraires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
718 "X..Eponges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
719 "X..Ascidies.Coloniales",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
720 "X..Ascidies.Solitaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
721 "X..Bryozoaires.Dresses",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
722 "X..Balanes.Vivantes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
723 #"Commentaires.Avant",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
724 "X..Surface.Accolement", # is NA, then replace by 0 as well because no sense to have a NA value for "% surface accolement" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
725 #"Type.sustrat.observé",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
726 #"Commentaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
727 "Nb.Cancer.pagurus..Tourteau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
728 "Nb.Necora.puber..Etrille.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
729 "Nb.Carcinus.maenas..Crabe.vert.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
730 "Nb.Nucella.lapilus..Pourpre.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
731 #.."Nb.Eriphia.verrucosa..Crabe.verruqueux.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
732 #.."Nb.Octopus.vulgaris..Poulpe.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
733 "Nb.Galathea..Galathées.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
734 #.."Nb.Paracentrotus.lividus..Oursin.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
735 "Nb.Lophozozymus.incisus..ancien.Xantho.incisus.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
736 "Nb.Palaemon.sp..Crevette.bouquet.ou.crevette.rose.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
737 "Nb.Haliotis.tuberculata..Ormeau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
738 #"Nb.Stramonita.haemastoma..Pourpre.bouche.de.sang.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
739 "Nb.Littorina.littorea..Bigorneau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
740 "Nb.Xantho.pilipes..Xanthe.poilu.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
741 "Nb.Mimachlamys.varia..Pétoncle.noir."
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
742 )
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
743 ], function(x) replace(x, is.na(x), 0))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
744
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
745
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
746 # bretagne_bf
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
747 bretagne_bf[, c(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
748 "X..algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
749 "Strate.algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
750 "X..algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
751 "Strate.algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
752 "X..algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
753 "Strate.algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
754 "X..Cladophora",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
755 "X..Lithophyllum",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
756 "X..Recouvrement.Sediment", # is NA, then replace by 0 as well because no sense to have a NA value for "% recouvrement sédiment" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
757 #"Type.Sediment",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
758 "X..Roche.Nue", # is NA, then replace by 0 as well because no sense to have a NA value for "% roche nue" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
759 "Nb.Littorina.obtusata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
760 "Nb.Gibbula.cineraria",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
761 "Nb.Gibbula.pennanti",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
762 "Nb.Gibbula.umbilicalis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
763 "Nb.Phallusia.mamillata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
764 "Nb.Tethya.aurantium",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
765 #"Nb.Spirobranchus.lamarckii.1B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
766 #"Nb.Spirobranchus.lamarckii.2B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
767 #"Nb.Spirobranchus.lamarckii.3B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
768 #"Nb.Spirobranchus.lamarckii.4B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
769 #"Nb.Spirobranchus.lamarckii.5B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
770 "Nb.Spirobranchus.lamarckii.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
771 #"Nb.spirorbis.1A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
772 #"Nb.spirorbis.2A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
773 #"Nb.spirorbis.3A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
774 #"Nb.spirorbis.4A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
775 #"Nb.spirorbis.5A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
776 "Nb.spirorbis.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
777 #.."Nb.Crassostrea.gigas",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
778 #.."Nb.Ostrea.edulis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
779 #.."X..Mytilus.sp.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
780 #.."X..Hermelles",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
781 #.."X..Hydraires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
782 "X..Eponges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
783 "X..Ascidies.Coloniales",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
784 "X..Ascidies.Solitaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
785 "X..Bryozoaires.Dresses",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
786 "X..Balanes.Vivantes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
787 #"Commentaires.Avant",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
788 "X..Surface.Accolement"#, # is NA, then replace by 0 as well because no sense to have a NA value for "% surface accolement" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
789 #"Type.sustrat.observé",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
790 #"Commentaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
791 #."Nb.Cancer.pagurus..Tourteau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
792 #.."Nb.Necora.puber..Etrille.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
793 #."Nb.Carcinus.maenas..Crabe.vert.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
794 #."Nb.Nucella.lapilus..Pourpre.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
795 #.."Nb.Eriphia.verrucosa..Crabe.verruqueux.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
796 #.."Nb.Octopus.vulgaris..Poulpe.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
797 #."Nb.Galathea..Galathées.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
798 #.."Nb.Paracentrotus.lividus..Oursin.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
799 #."Nb.Lophozozymus.incisus..ancien.Xantho.incisus.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
800 #."Nb.Palaemon.sp..Crevette.bouquet.ou.crevette.rose.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
801 #."Nb.Haliotis.tuberculata..Ormeau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
802 #."Nb.Stramonita.haemastoma..Pourpre.bouche.de.sang.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
803 #."Nb.Littorina.littorea..Bigorneau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
804 #."Nb.Xantho.pilipes..Xanthe.poilu.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
805 #."Nb.Mimachlamys.varia..Pétoncle.noir."
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
806 )
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
807 ] <- lapply(bretagne_bf[, c(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
808 "X..algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
809 "Strate.algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
810 "X..algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
811 "Strate.algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
812 "X..algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
813 "Strate.algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
814 "X..Cladophora",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
815 "X..Lithophyllum",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
816 "X..Recouvrement.Sediment", # is NA, then replace by 0 as well because no sense to have a NA value for "% recouvrement sédiment" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
817 #"Type.Sediment",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
818 "X..Roche.Nue", # is NA, then replace by 0 as well because no sense to have a NA value for "% roche nue" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
819 "Nb.Littorina.obtusata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
820 "Nb.Gibbula.cineraria",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
821 "Nb.Gibbula.pennanti",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
822 "Nb.Gibbula.umbilicalis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
823 "Nb.Phallusia.mamillata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
824 "Nb.Tethya.aurantium",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
825 #"Nb.Spirobranchus.lamarckii.1B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
826 #"Nb.Spirobranchus.lamarckii.2B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
827 #"Nb.Spirobranchus.lamarckii.3B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
828 #"Nb.Spirobranchus.lamarckii.4B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
829 #"Nb.Spirobranchus.lamarckii.5B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
830 "Nb.Spirobranchus.lamarckii.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
831 #"Nb.spirorbis.1A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
832 #"Nb.spirorbis.2A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
833 #"Nb.spirorbis.3A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
834 #"Nb.spirorbis.4A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
835 #"Nb.spirorbis.5A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
836 "Nb.spirorbis.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
837 #.."Nb.Crassostrea.gigas",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
838 #.."Nb.Ostrea.edulis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
839 #.."X..Mytilus.sp.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
840 #.."X..Hermelles",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
841 #.."X..Hydraires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
842 "X..Eponges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
843 "X..Ascidies.Coloniales",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
844 "X..Ascidies.Solitaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
845 "X..Bryozoaires.Dresses",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
846 "X..Balanes.Vivantes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
847 #"Commentaires.Avant",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
848 "X..Surface.Accolement"#, # is NA, then replace by 0 as well because no sense to have a NA value for "% surface accolement" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
849 #"Type.sustrat.observé",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
850 #"Commentaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
851 #."Nb.Cancer.pagurus..Tourteau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
852 #.."Nb.Necora.puber..Etrille.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
853 #."Nb.Carcinus.maenas..Crabe.vert.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
854 #."Nb.Nucella.lapilus..Pourpre.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
855 #.."Nb.Eriphia.verrucosa..Crabe.verruqueux.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
856 #.."Nb.Octopus.vulgaris..Poulpe.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
857 #."Nb.Galathea..Galathées.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
858 #.."Nb.Paracentrotus.lividus..Oursin.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
859 #."Nb.Lophozozymus.incisus..ancien.Xantho.incisus.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
860 #."Nb.Palaemon.sp..Crevette.bouquet.ou.crevette.rose.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
861 #."Nb.Haliotis.tuberculata..Ormeau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
862 #."Nb.Stramonita.haemastoma..Pourpre.bouche.de.sang.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
863 #."Nb.Littorina.littorea..Bigorneau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
864 #."Nb.Xantho.pilipes..Xanthe.poilu.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
865 #."Nb.Mimachlamys.varia..Pétoncle.noir."
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
866 )
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
867 ], function(x) replace(x, is.na(x), 0))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
868
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
869
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
870 # egmp_basq_bm
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
871 egmp_basq_bm[, c(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
872 "X..algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
873 "Strate.algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
874 "X..algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
875 "Strate.algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
876 "X..algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
877 "Strate.algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
878 "X..Cladophora",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
879 "X..Lithophyllum",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
880 "X..Recouvrement.Sediment", # is NA, then replace by 0 as well because no sense to have a NA value for "% recouvrement sédiment" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
881 #"Type.Sediment",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
882 "X..Roche.Nue", # is NA, then replace by 0 as well because no sense to have a NA value for "% roche nue" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
883 "Nb.Littorina.obtusata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
884 "Nb.Gibbula.cineraria",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
885 "Nb.Gibbula.pennanti",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
886 "Nb.Gibbula.umbilicalis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
887 "Nb.Phallusia.mamillata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
888 "Nb.Tethya.aurantium",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
889 #"Nb.Spirobranchus.lamarckii.1B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
890 #"Nb.Spirobranchus.lamarckii.2B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
891 #"Nb.Spirobranchus.lamarckii.3B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
892 #"Nb.Spirobranchus.lamarckii.4B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
893 #"Nb.Spirobranchus.lamarckii.5B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
894 "Nb.Spirobranchus.lamarckii.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
895 #"Nb.spirorbis.1A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
896 #"Nb.spirorbis.2A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
897 #"Nb.spirorbis.3A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
898 #"Nb.spirorbis.4A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
899 #"Nb.spirorbis.5A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
900 "Nb.spirorbis.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
901 "Nb.Crassostrea.gigas",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
902 "Nb.Ostrea.edulis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
903 "X..Mytilus.sp.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
904 "X..Hermelles",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
905 "X..Hydraires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
906 "X..Eponges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
907 "X..Ascidies.Coloniales",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
908 "X..Ascidies.Solitaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
909 "X..Bryozoaires.Dresses",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
910 "X..Balanes.Vivantes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
911 #"Commentaires.Avant",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
912 "X..Surface.Accolement", # is NA, then replace by 0 as well because no sense to have a NA value for "% surface accolement" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
913 #"Type.sustrat.observé",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
914 #"Commentaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
915 "Nb.Cancer.pagurus..Tourteau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
916 "Nb.Necora.puber..Etrille.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
917 "Nb.Carcinus.maenas..Crabe.vert.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
918 "Nb.Nucella.lapilus..Pourpre.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
919 "Nb.Eriphia.verrucosa..Crabe.verruqueux.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
920 "Nb.Octopus.vulgaris..Poulpe.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
921 "Nb.Galathea..Galathées.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
922 "Nb.Paracentrotus.lividus..Oursin.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
923 "Nb.Lophozozymus.incisus..ancien.Xantho.incisus.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
924 "Nb.Palaemon.sp..Crevette.bouquet.ou.crevette.rose.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
925 "Nb.Haliotis.tuberculata..Ormeau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
926 "Nb.Stramonita.haemastoma..Pourpre.bouche.de.sang.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
927 "Nb.Littorina.littorea..Bigorneau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
928 "Nb.Xantho.pilipes..Xanthe.poilu.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
929 "Nb.Mimachlamys.varia..Pétoncle.noir."
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
930 )
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
931 ] <- lapply(egmp_basq_bm[, c(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
932 "X..algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
933 "Strate.algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
934 "X..algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
935 "Strate.algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
936 "X..algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
937 "Strate.algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
938 "X..Cladophora",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
939 "X..Lithophyllum",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
940 "X..Recouvrement.Sediment", # is NA, then replace by 0 as well because no sense to have a NA value for "% recouvrement sédiment" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
941 #"Type.Sediment",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
942 "X..Roche.Nue", # is NA, then replace by 0 as well because no sense to have a NA value for "% roche nue" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
943 "Nb.Littorina.obtusata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
944 "Nb.Gibbula.cineraria",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
945 "Nb.Gibbula.pennanti",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
946 "Nb.Gibbula.umbilicalis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
947 "Nb.Phallusia.mamillata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
948 "Nb.Tethya.aurantium",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
949 #"Nb.Spirobranchus.lamarckii.1B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
950 #"Nb.Spirobranchus.lamarckii.2B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
951 #"Nb.Spirobranchus.lamarckii.3B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
952 #"Nb.Spirobranchus.lamarckii.4B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
953 #"Nb.Spirobranchus.lamarckii.5B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
954 "Nb.Spirobranchus.lamarckii.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
955 #"Nb.spirorbis.1A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
956 #"Nb.spirorbis.2A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
957 #"Nb.spirorbis.3A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
958 #"Nb.spirorbis.4A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
959 #"Nb.spirorbis.5A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
960 "Nb.spirorbis.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
961 "Nb.Crassostrea.gigas",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
962 "Nb.Ostrea.edulis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
963 "X..Mytilus.sp.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
964 "X..Hermelles",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
965 "X..Hydraires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
966 "X..Eponges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
967 "X..Ascidies.Coloniales",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
968 "X..Ascidies.Solitaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
969 "X..Bryozoaires.Dresses",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
970 "X..Balanes.Vivantes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
971 #"Commentaires.Avant",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
972 "X..Surface.Accolement", # is NA, then replace by 0 as well because no sense to have a NA value for "% surface accolement" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
973 #"Type.sustrat.observé",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
974 #"Commentaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
975 "Nb.Cancer.pagurus..Tourteau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
976 "Nb.Necora.puber..Etrille.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
977 "Nb.Carcinus.maenas..Crabe.vert.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
978 "Nb.Nucella.lapilus..Pourpre.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
979 "Nb.Eriphia.verrucosa..Crabe.verruqueux.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
980 "Nb.Octopus.vulgaris..Poulpe.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
981 "Nb.Galathea..Galathées.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
982 "Nb.Paracentrotus.lividus..Oursin.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
983 "Nb.Lophozozymus.incisus..ancien.Xantho.incisus.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
984 "Nb.Palaemon.sp..Crevette.bouquet.ou.crevette.rose.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
985 "Nb.Haliotis.tuberculata..Ormeau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
986 "Nb.Stramonita.haemastoma..Pourpre.bouche.de.sang.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
987 "Nb.Littorina.littorea..Bigorneau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
988 "Nb.Xantho.pilipes..Xanthe.poilu.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
989 "Nb.Mimachlamys.varia..Pétoncle.noir."
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
990 )
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
991 ], function(x) replace(x, is.na(x), 0))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
992
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
993
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
994 # egmp_basq_bf
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
995 egmp_basq_bf[, c(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
996 "X..algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
997 "Strate.algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
998 "X..algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
999 "Strate.algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1000 "X..algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1001 "Strate.algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1002 "X..Cladophora",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1003 "X..Lithophyllum",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1004 "X..Recouvrement.Sediment", # is NA, then replace by 0 as well because no sense to have a NA value for "% recouvrement sédiment" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1005 #"Type.Sediment",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1006 "X..Roche.Nue", # is NA, then replace by 0 as well because no sense to have a NA value for "% roche nue" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1007 "Nb.Littorina.obtusata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1008 "Nb.Gibbula.cineraria",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1009 "Nb.Gibbula.pennanti",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1010 "Nb.Gibbula.umbilicalis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1011 "Nb.Phallusia.mamillata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1012 "Nb.Tethya.aurantium",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1013 #"Nb.Spirobranchus.lamarckii.1B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1014 #"Nb.Spirobranchus.lamarckii.2B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1015 #"Nb.Spirobranchus.lamarckii.3B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1016 #"Nb.Spirobranchus.lamarckii.4B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1017 #"Nb.Spirobranchus.lamarckii.5B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1018 "Nb.Spirobranchus.lamarckii.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1019 #"Nb.spirorbis.1A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1020 #"Nb.spirorbis.2A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1021 #"Nb.spirorbis.3A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1022 #"Nb.spirorbis.4A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1023 #"Nb.spirorbis.5A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1024 "Nb.spirorbis.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1025 "Nb.Crassostrea.gigas",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1026 "Nb.Ostrea.edulis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1027 "X..Mytilus.sp.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1028 "X..Hermelles",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1029 "X..Hydraires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1030 "X..Eponges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1031 "X..Ascidies.Coloniales",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1032 "X..Ascidies.Solitaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1033 "X..Bryozoaires.Dresses",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1034 "X..Balanes.Vivantes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1035 #"Commentaires.Avant",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1036 "X..Surface.Accolement"#, # is NA, then replace by 0 as well because no sense to have a NA value for "% surface accolement" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1037 #"Type.sustrat.observé",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1038 #"Commentaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1039 #."Nb.Cancer.pagurus..Tourteau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1040 #.."Nb.Necora.puber..Etrille.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1041 #."Nb.Carcinus.maenas..Crabe.vert.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1042 #."Nb.Nucella.lapilus..Pourpre.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1043 #.."Nb.Eriphia.verrucosa..Crabe.verruqueux.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1044 #.."Nb.Octopus.vulgaris..Poulpe.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1045 #."Nb.Galathea..Galathées.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1046 #.."Nb.Paracentrotus.lividus..Oursin.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1047 #."Nb.Lophozozymus.incisus..ancien.Xantho.incisus.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1048 #."Nb.Palaemon.sp..Crevette.bouquet.ou.crevette.rose.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1049 #."Nb.Haliotis.tuberculata..Ormeau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1050 #."Nb.Stramonita.haemastoma..Pourpre.bouche.de.sang.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1051 #."Nb.Littorina.littorea..Bigorneau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1052 #."Nb.Xantho.pilipes..Xanthe.poilu.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1053 #."Nb.Mimachlamys.varia..Pétoncle.noir."
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1054 )
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1055 ] <- lapply(egmp_basq_bf[, c(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1056 "X..algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1057 "Strate.algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1058 "X..algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1059 "Strate.algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1060 "X..algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1061 "Strate.algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1062 "X..Cladophora",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1063 "X..Lithophyllum",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1064 "X..Recouvrement.Sediment", # is NA, then replace by 0 as well because no sense to have a NA value for "% recouvrement sédiment" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1065 #"Type.Sediment",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1066 "X..Roche.Nue", # is NA, then replace by 0 as well because no sense to have a NA value for "% roche nue" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1067 "Nb.Littorina.obtusata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1068 "Nb.Gibbula.cineraria",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1069 "Nb.Gibbula.pennanti",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1070 "Nb.Gibbula.umbilicalis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1071 "Nb.Phallusia.mamillata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1072 "Nb.Tethya.aurantium",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1073 #"Nb.Spirobranchus.lamarckii.1B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1074 #"Nb.Spirobranchus.lamarckii.2B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1075 #"Nb.Spirobranchus.lamarckii.3B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1076 #"Nb.Spirobranchus.lamarckii.4B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1077 #"Nb.Spirobranchus.lamarckii.5B",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1078 "Nb.Spirobranchus.lamarckii.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1079 #"Nb.spirorbis.1A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1080 #"Nb.spirorbis.2A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1081 #"Nb.spirorbis.3A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1082 #"Nb.spirorbis.4A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1083 #"Nb.spirorbis.5A",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1084 "Nb.spirorbis.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1085 "Nb.Crassostrea.gigas",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1086 "Nb.Ostrea.edulis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1087 "X..Mytilus.sp.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1088 "X..Hermelles",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1089 "X..Hydraires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1090 "X..Eponges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1091 "X..Ascidies.Coloniales",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1092 "X..Ascidies.Solitaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1093 "X..Bryozoaires.Dresses",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1094 "X..Balanes.Vivantes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1095 #"Commentaires.Avant",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1096 "X..Surface.Accolement"#, # is NA, then replace by 0 as well because no sense to have a NA value for "% surface accolement" as well.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1097 #"Type.sustrat.observé",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1098 #"Commentaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1099 #."Nb.Cancer.pagurus..Tourteau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1100 #.."Nb.Necora.puber..Etrille.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1101 #."Nb.Carcinus.maenas..Crabe.vert.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1102 #."Nb.Nucella.lapilus..Pourpre.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1103 #.."Nb.Eriphia.verrucosa..Crabe.verruqueux.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1104 #.."Nb.Octopus.vulgaris..Poulpe.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1105 #."Nb.Galathea..Galathées.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1106 #.."Nb.Paracentrotus.lividus..Oursin.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1107 #."Nb.Lophozozymus.incisus..ancien.Xantho.incisus.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1108 #."Nb.Palaemon.sp..Crevette.bouquet.ou.crevette.rose.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1109 #."Nb.Haliotis.tuberculata..Ormeau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1110 #."Nb.Stramonita.haemastoma..Pourpre.bouche.de.sang.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1111 #."Nb.Littorina.littorea..Bigorneau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1112 #."Nb.Xantho.pilipes..Xanthe.poilu.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1113 #."Nb.Mimachlamys.varia..Pétoncle.noir."
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1114 )
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1115 ], function(x) replace(x, is.na(x), 0))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1116
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1117
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1118 # merge dfs.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1119 qecbnato0 <- dplyr::bind_rows(bretagne_bm, bretagne_bf)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1120 qecbnato0 <- dplyr::bind_rows(qecbnato0, egmp_basq_bm)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1121 qecbnato0 <- dplyr::bind_rows(qecbnato0, egmp_basq_bf)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1122
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1123 qecbnato0 <- dplyr::arrange(qecbnato0, region, site_year_month_day, Type.Bloc, Numéro.Bloc.échantillon, Face)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1124
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1125 rm(bretagne_bm, bretagne_bf, egmp_basq_bm, egmp_basq_bf)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1126
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1127
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1128 ## analyse matricielle
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1129
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1130 # NB some variables were dplyr::renamed or created, cfr I originally merged qecb and ivr data in below script to do some correlation analysis. This is not the case anymore, so no more merging anymore.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1131
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1132 qecbnato0 <- tibble::add_column(qecbnato0, region.site_year_month_day = paste0(qecbnato0$region, qecbnato0$site_year_month_day), .before = "region")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1133
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1134
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1135 numero_quadrat <- stringr::str_sub(qecbnato0$quadrat_bis, start = -1)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1136 qecbnato0 <- tibble::add_column(qecbnato0, numero_quadrat, .after = "quadrat_bis")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1137 rm(numero_quadrat)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1138 qecbnato0$numero_quadrat <- as.integer(qecbnato0$numero_quadrat)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1139
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1140
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1141 qecbnato0$Year <- as.integer(qecbnato0$Year)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1142 qecbnato0$Month <- as.integer(qecbnato0$Month)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1143 qecbnato0$Day <- as.integer(qecbnato0$Day)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1144
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1145 ############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1146 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1147 # Anna still hasn't corrected for boulder nb in FINS_Quemenes.2020.10.16 data encoding ! removed from the df_
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1148 qecbnato0 <- qecbnato0 %>% dplyr::filter(site_year_month_day != "FINS_Quemenes.2020.10.16")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1149 ############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1150
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1151 # what to do with spirorbes & Nb.Spirobranchus.lamarckii.total? log10 transformation
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1152
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1153 qecbnato0 <- tibble::add_column(qecbnato0, log10.Nb.spirorbis.total = log10(qecbnato0$Nb.spirorbis.total + 1), .after = "Nb.spirorbis.total")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1154 qecbnato0 <- tibble::add_column(qecbnato0, log10.Nb.Spirobranchus.lamarckii.total = log10(qecbnato0$Nb.Spirobranchus.lamarckii.total + 1), .after = "Nb.Spirobranchus.lamarckii.total")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1155
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1156 saveRDS(qecbnato0, "qecbnato0.RDS")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1157
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1158
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1159 ###############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1160 # #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1161 # Start dissimilarity calculation with some data handling #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1162 # #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1163 ###############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1164
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1165 # first, create vector (4) for qecb and fishing by region (same as above)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1166
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1167 bret_egmp_basq_qecb <- c(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1168 "X..algues.brunes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1169 "X..algues.rouges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1170 "X..algues.vertes",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1171 "X..Cladophora",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1172 "X..Lithophyllum",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1173 "Nb.Littorina.obtusata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1174 "Nb.Gibbula.cineraria",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1175 "Nb.Gibbula.pennanti",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1176 "Nb.Gibbula.umbilicalis",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1177 "Nb.Phallusia.mamillata",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1178 "Nb.Tethya.aurantium",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1179 "Nb.Spirobranchus.lamarckii.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1180 "Nb.spirorbis.total",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1181 "X..Eponges",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1182 "X..Ascidies.Coloniales",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1183 "X..Ascidies.Solitaires",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1184 "X..Bryozoaires.Dresses",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1185 "X..Balanes.Vivantes"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1186 #, "X..Recouvrement.Sediment"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1187 #, "X..Roche.Nue"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1188 #, "X..Surface.Accolement"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1189 )
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1190
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1191 egmp_basq_qecb <- c("Nb.Crassostrea.gigas", "Nb.Ostrea.edulis", "X..Mytilus.sp.", "X..Hermelles", "X..Hydraires")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1192
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1193 bret_egmp_basq_fishing <- c("Nb.Cancer.pagurus..Tourteau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1194 "Nb.Necora.puber..Etrille.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1195 "Nb.Carcinus.maenas..Crabe.vert.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1196 "Nb.Nucella.lapilus..Pourpre.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1197 "Nb.Galathea..Galathées.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1198 "Nb.Lophozozymus.incisus..ancien.Xantho.incisus.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1199 "Nb.Palaemon.sp..Crevette.bouquet.ou.crevette.rose.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1200 "Nb.Haliotis.tuberculata..Ormeau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1201 "Nb.Littorina.littorea..Bigorneau.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1202 "Nb.Xantho.pilipes..Xanthe.poilu.",
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1203 "Nb.Mimachlamys.varia..Pétoncle.noir.")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1204
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1205 egmp_basq_fishing <- c("Nb.Eriphia.verrucosa..Crabe.verruqueux.", "Nb.Octopus.vulgaris..Poulpe.", "Nb.Paracentrotus.lividus..Oursin.", "Nb.Stramonita.haemastoma..Pourpre.bouche.de.sang.")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1206
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1207 # here I can choose to either replace spirorbis and/or spirobranchus by their log10 transformation in bret_egmp_basq_qecb vector
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1208 bret_egmp_basq_qecb <- replace(bret_egmp_basq_qecb, bret_egmp_basq_qecb == "Nb.spirorbis.total", "log10.Nb.spirorbis.total")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1209 saveRDS(bret_egmp_basq_qecb, "bret_egmp_basq_qecb.RDS")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1210
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1211
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1212 #############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1213 # #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1214 # Compute dissimilarity #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1215 # #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1216 #############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1217 ### determination of coefficient of dissimilarity face sup mobile bloc vs fixed bloc
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1218
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1219 # loop in a fct
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1220
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1221 matri_fct_bmf <- function(data, conca) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1222
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1223 matri_df <- data
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1224
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1225 for (x in c(1:length(unique(matri_df$site_year_month_day)))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1226
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1227 qecbnato0_x <- matri_df %>% dplyr::filter(site_year_month_day == unique(matri_df$site_year_month_day)[[x]])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1228
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1229 rownames(qecbnato0_x) <- paste0(qecbnato0_x$Type.Bloc, "_", qecbnato0_x$Face, "_", qecbnato0_x$Numéro.Bloc.échantillon, "_", qecbnato0_x$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1230
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1231
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1232 mtxdis <- vegan::vegdist(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1233 sqrt(qecbnato0_x[, conca]), #Transform your species abundance data_ Typically, raw abundances are transformed prior to analysis. Usually you will use square root, fourth-root, log(X+1), or presence-absence (square root being least extreme, P/A being most). I would start with square root. (https://stats.stackexchange.com/questions/234495/double-zeroes-problem-with-euclidean-distance-and-abundance-data-is-the-proble)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1234
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1235 na.rm = TRUE,
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1236 method = "bray" #Construct species abundance dissimilarity matrices with Bray-Curtis. If your data contains samples that are all-zero you will run into the double zero problem. This can be overcome by using a zero-adjusted Bray-Curtis coefficient, which is sometimes referred to as a 'dummy variable' which damps down the similarity fluctuations between samples that are both zero (undefined). => see below for zero-adjusted Bray-Curtis coefficient ; #another possibility, sqrt + 1 ??
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1237 )
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1238
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1239
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1240 #https://rdrr.io/github/phytomosaic/ecole/man/bray0.html
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1241 # mtxdis <- ecole::bray0(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1242 # sqrt
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1243 # (qecbnato0_x[,conca]), na.rm = TRUE)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1244
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1245 expand.grid(mtxdis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1246
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1247 mtxdisdf_ <- as.data.frame(as.matrix(mtxdis))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1248
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1249 a_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1250 b_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1251 c_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1252 d_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1253 e_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1254 f_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1255 g_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1256 h_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1257 i_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1258 j_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1259 k_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1260 l_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1261 m_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1262 n_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1263
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1264 for (z in c(1:nrow(mtxdisdf_))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1265
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1266 a_[[z]] <- (paste0(rownames(mtxdisdf_[z + 1, ]), " & ", ifelse(nrow(mtxdisdf_) >= 1, colnames(mtxdisdf_[1]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1267 b_[[z]] <- (paste0(rownames(mtxdisdf_[z + 2, ]), " & ", ifelse(nrow(mtxdisdf_) >= 2, colnames(mtxdisdf_[2]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1268 c_[[z]] <- (paste0(rownames(mtxdisdf_[z + 3, ]), " & ", ifelse(nrow(mtxdisdf_) >= 3, colnames(mtxdisdf_[3]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1269 d_[[z]] <- (paste0(rownames(mtxdisdf_[z + 4, ]), " & ", ifelse(nrow(mtxdisdf_) >= 4, colnames(mtxdisdf_[4]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1270 e_[[z]] <- (paste0(rownames(mtxdisdf_[z + 5, ]), " & ", ifelse(nrow(mtxdisdf_) >= 5, colnames(mtxdisdf_[5]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1271 f_[[z]] <- (paste0(rownames(mtxdisdf_[z + 6, ]), " & ", ifelse(nrow(mtxdisdf_) >= 6, colnames(mtxdisdf_[6]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1272 g_[[z]] <- (paste0(rownames(mtxdisdf_[z + 7, ]), " & ", ifelse(nrow(mtxdisdf_) >= 7, colnames(mtxdisdf_[7]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1273 h_[[z]] <- (paste0(rownames(mtxdisdf_[z + 8, ]), " & ", ifelse(nrow(mtxdisdf_) >= 8, colnames(mtxdisdf_[8]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1274 i_[[z]] <- (paste0(rownames(mtxdisdf_[z + 9, ]), " & ", ifelse(nrow(mtxdisdf_) >= 9, colnames(mtxdisdf_[9]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1275 j_[[z]] <- (paste0(rownames(mtxdisdf_[z + 10, ]), " & ", ifelse(nrow(mtxdisdf_) >= 10, colnames(mtxdisdf_[10]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1276 k_[[z]] <- (paste0(rownames(mtxdisdf_[z + 11, ]), " & ", ifelse(nrow(mtxdisdf_) >= 11, colnames(mtxdisdf_[11]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1277 l_[[z]] <- (paste0(rownames(mtxdisdf_[z + 12, ]), " & ", ifelse(nrow(mtxdisdf_) >= 12, colnames(mtxdisdf_[12]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1278 m_[[z]] <- (paste0(rownames(mtxdisdf_[z + 13, ]), " & ", ifelse(nrow(mtxdisdf_) >= 13, colnames(mtxdisdf_[13]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1279 n_[[z]] <- (paste0(rownames(mtxdisdf_[z + 14, ]), " & ", ifelse(nrow(mtxdisdf_) >= 14, colnames(mtxdisdf_[14]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1280
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1281 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1282
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1283 rm(z)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1284
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1285 y <- length(a_) - (ifelse(nrow(mtxdisdf_) >= 1, 1, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1286 a_ <- a_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1287 y <- length(b_) - (ifelse(nrow(mtxdisdf_) >= 2, 2, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1288 b_ <- b_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1289 y <- length(c_) - (ifelse(nrow(mtxdisdf_) >= 3, 3, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1290 c_ <- c_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1291 y <- length(d_) - (ifelse(nrow(mtxdisdf_) >= 4, 4, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1292 d_ <- d_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1293 y <- length(e_) - (ifelse(nrow(mtxdisdf_) >= 5, 5, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1294 e_ <- e_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1295 y <- length(f_) - (ifelse(nrow(mtxdisdf_) >= 6, 6, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1296 f_ <- f_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1297 y <- length(g_) - (ifelse(nrow(mtxdisdf_) >= 7, 7, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1298 g_ <- g_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1299 y <- length(h_) - (ifelse(nrow(mtxdisdf_) >= 8, 8, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1300 h_ <- h_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1301 y <- length(i_) - (ifelse(nrow(mtxdisdf_) >= 9, 9, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1302 i_ <- i_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1303 y <- length(j_) - (ifelse(nrow(mtxdisdf_) >= 10, 10, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1304 j_ <- j_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1305 y <- length(k_) - (ifelse(nrow(mtxdisdf_) >= 11, 11, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1306 k_ <- k_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1307 y <- length(l_) - (ifelse(nrow(mtxdisdf_) >= 12, 12, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1308 l_ <- l_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1309 y <- length(m_) - (ifelse(nrow(mtxdisdf_) >= 13, 13, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1310 m_ <- m_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1311 y <- length(n_) - (ifelse(nrow(mtxdisdf_) >= 14, 14, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1312 n_ <- n_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1313
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1314 rm(y)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1315
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1316 name_ <- c(a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_, l_, m_, n_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1317 df_ <- data.frame(expand.grid(mtxdis), name_[1:nrow(expand.grid(mtxdis))])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1318 names(df_) <- c("dist.", "name_")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1319
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1320 rm(a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_, l_, m_, n_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1321 rm(name_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1322
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1323 q_ <- strsplit(df_$name_, " & ")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1324 mat_ <- matrix(unlist(q_), ncol = 2, byrow = TRUE)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1325 q_df_ <- as.data.frame(matrix(unlist(q_), ncol = 2, byrow = TRUE))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1326 df_ <- dplyr::bind_cols(df_, q_df_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1327
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1328 rm(q_, mat_, q_df_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1329
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1330 split_ <- strsplit(df_$V1, "_")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1331 v1_split_ <- as.data.frame(matrix(unlist(split_), ncol = 4, byrow = TRUE))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1332 split_ <- strsplit(df_$V2, "_")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1333 v2_split_ <- as.data.frame(matrix(unlist(split_), ncol = 4, byrow = TRUE))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1334
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1335 df_ <- dplyr::bind_cols(df_, v1_split_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1336 df_ <- dplyr::bind_cols(df_, v2_split_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1337 df_red_ <- subset(df_, V4...8 == V4...12 & V1...5 != V1...9)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1338 site_year_month_day <- rep(unique(qecbnato0_x$site_year_month_day), nrow(df_red_))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1339
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1340 df_red_ <- tibble::add_column(df_red_, site_year_month_day, .before = "dist.")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1341
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1342 rm(split_, v1_split_, v2_split_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1343 rm(mtxdis, mtxdisdf_, df_, site_year_month_day)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1344
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1345 matri_list[[x]] <- df_red_
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1346 matri_list <<- matri_list
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1347
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1348 rm(df_red_, qecbnato0_x, x)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1349
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1350 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1351
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1352 matri_df <- do.call("rbind", matri_list)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1353
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1354 names(matri_df) <- c("site_year_month_day", "dist.", "name_", "name_left", "name_right", "Type.Bloc.left", "Face.left", "Numéro.Bloc.échantillon.left", "Quadrat.left", "Type.Bloc.right", "Face.right", "Numéro.Bloc.échantillon.right", "Quadrat.right")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1355
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1356 matri_df <<- matri_df
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1357
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1358 hist(matri_df$dist.)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1359
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1360 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1361
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1362 data_ <- dplyr::filter(qecbnato0, Face == "face supérieure")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1363 data_$Type.Bloc <- ifelse(as.character(data_$Type.Bloc) == "Roche en place", "Bloc fixé", as.character(data_$Type.Bloc))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1364 matri_list <- vector("list", length(unique(data_$site_year_month_day)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1365
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1366 matri_fct_bmf(data = data_, conca = c(bret_egmp_basq_qecb, egmp_basq_qecb))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1367 hist(matri_df$dist., main = c(paste("Histo. of Bray (0-adjusted) dist. dissimilarity measures"), paste(" (sqrt transfo) - BMfs vs BF -")))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1368
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1369 matri_full_bm_bf_fs <- matri_df
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1370
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1371
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1372 rm(data_, matri_df, matri_list)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1373
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1374
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1375 ### determination of coefficient of dissimilarity between blocs mobiles face sup vs face inf.
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1376
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1377 # loop in a fct
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1378
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1379 matri_fct_bmm <- function(data, conca) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1380
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1381 matri_df <- data
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1382
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1383 for (x in c(1:length(unique(matri_df$site_year_month_day)))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1384
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1385 qecbnato0_x <- matri_df %>% dplyr::filter(site_year_month_day == unique(matri_df$site_year_month_day)[[x]])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1386
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1387 rownames(qecbnato0_x) <- paste0(qecbnato0_x$Type.Bloc, "_", qecbnato0_x$Face, "_", qecbnato0_x$Numéro.Bloc.échantillon, "_", qecbnato0_x$quadrat_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1388
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1389
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1390 mtxdis <- vegan::vegdist(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1391 sqrt(qecbnato0_x[, c(bret_egmp_basq_qecb)]), #Transform your species abundance data_ Typically, raw abundances are transformed prior to analysis. Usually you will use square root, fourth-root, log(X+1), or presence-absence (square root being least extreme, P/A being most). I would start with square root. (https://stats.stackexchange.com/questions/234495/double-zeroes-problem-with-euclidean-distance-and-abundance-data-is-the-proble)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1392 na.rm = TRUE,
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1393 method = "bray" #Construct species abundance dissimilarity matrices with Bray-Curtis. If your data contains samples that are all-zero you will run into the double zero problem. This can be overcome by using a zero-adjusted Bray-Curtis coefficient, which is sometimes referred to as a 'dummy variable' which damps down the similarity fluctuations between samples that are both zero (undefined). => see below for zero-adjusted Bray-Curtis coefficient ; #another possibility, sqrt + 1 ??
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1394 )
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1395
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1396
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1397 #mtxdis <- ecole::bray0(
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1398 # sqrt(qecbnato0_x[, conca]), na.rm = TRUE)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1399
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1400
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1401 expand.grid(mtxdis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1402
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1403 mtxdisdf_ <- as.data.frame(as.matrix(mtxdis))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1404
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1405 a_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1406 b_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1407 c_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1408 d_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1409 e_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1410 f_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1411 g_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1412 h_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1413 i_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1414 j_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1415 k_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1416 l_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1417 m_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1418 n_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1419 o_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1420 p_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1421 q_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1422 r_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1423 s_ <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1424
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1425 for (z in c(1:nrow(mtxdisdf_))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1426
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1427 a_[[z]] <- (paste0(rownames(mtxdisdf_[z + 1, ]), " & ", ifelse(nrow(mtxdisdf_) >= 1, colnames(mtxdisdf_[1]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1428 b_[[z]] <- (paste0(rownames(mtxdisdf_[z + 2, ]), " & ", ifelse(nrow(mtxdisdf_) >= 2, colnames(mtxdisdf_[2]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1429 c_[[z]] <- (paste0(rownames(mtxdisdf_[z + 3, ]), " & ", ifelse(nrow(mtxdisdf_) >= 3, colnames(mtxdisdf_[3]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1430 d_[[z]] <- (paste0(rownames(mtxdisdf_[z + 4, ]), " & ", ifelse(nrow(mtxdisdf_) >= 4, colnames(mtxdisdf_[4]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1431 e_[[z]] <- (paste0(rownames(mtxdisdf_[z + 5, ]), " & ", ifelse(nrow(mtxdisdf_) >= 5, colnames(mtxdisdf_[5]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1432 f_[[z]] <- (paste0(rownames(mtxdisdf_[z + 6, ]), " & ", ifelse(nrow(mtxdisdf_) >= 6, colnames(mtxdisdf_[6]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1433 g_[[z]] <- (paste0(rownames(mtxdisdf_[z + 7, ]), " & ", ifelse(nrow(mtxdisdf_) >= 7, colnames(mtxdisdf_[7]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1434 h_[[z]] <- (paste0(rownames(mtxdisdf_[z + 8, ]), " & ", ifelse(nrow(mtxdisdf_) >= 8, colnames(mtxdisdf_[8]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1435 i_[[z]] <- (paste0(rownames(mtxdisdf_[z + 9, ]), " & ", ifelse(nrow(mtxdisdf_) >= 9, colnames(mtxdisdf_[9]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1436 j_[[z]] <- (paste0(rownames(mtxdisdf_[z + 10, ]), " & ", ifelse(nrow(mtxdisdf_) >= 10, colnames(mtxdisdf_[10]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1437 k_[[z]] <- (paste0(rownames(mtxdisdf_[z + 11, ]), " & ", ifelse(nrow(mtxdisdf_) >= 11, colnames(mtxdisdf_[11]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1438 l_[[z]] <- (paste0(rownames(mtxdisdf_[z + 12, ]), " & ", ifelse(nrow(mtxdisdf_) >= 12, colnames(mtxdisdf_[12]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1439 m_[[z]] <- (paste0(rownames(mtxdisdf_[z + 13, ]), " & ", ifelse(nrow(mtxdisdf_) >= 13, colnames(mtxdisdf_[13]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1440 n_[[z]] <- (paste0(rownames(mtxdisdf_[z + 14, ]), " & ", ifelse(nrow(mtxdisdf_) >= 14, colnames(mtxdisdf_[14]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1441 o_[[z]] <- (paste0(rownames(mtxdisdf_[z + 15, ]), " & ", ifelse(nrow(mtxdisdf_) >= 15, colnames(mtxdisdf_[15]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1442 p_[[z]] <- (paste0(rownames(mtxdisdf_[z + 16, ]), " & ", ifelse(nrow(mtxdisdf_) >= 16, colnames(mtxdisdf_[16]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1443 q_[[z]] <- (paste0(rownames(mtxdisdf_[z + 17, ]), " & ", ifelse(nrow(mtxdisdf_) >= 17, colnames(mtxdisdf_[17]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1444 r_[[z]] <- (paste0(rownames(mtxdisdf_[z + 18, ]), " & ", ifelse(nrow(mtxdisdf_) >= 18, colnames(mtxdisdf_[18]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1445 s_[[z]] <- (paste0(rownames(mtxdisdf_[z + 19, ]), " & ", ifelse(nrow(mtxdisdf_) >= 19, colnames(mtxdisdf_[19]), NA)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1446
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1447 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1448
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1449 rm(z)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1450
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1451 y <- length(a_) - (ifelse(nrow(mtxdisdf_) >= 1, 1, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1452 a_ <- a_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1453 y <- length(b_) - (ifelse(nrow(mtxdisdf_) >= 2, 2, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1454 b_ <- b_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1455 y <- length(c_) - (ifelse(nrow(mtxdisdf_) >= 3, 3, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1456 c_ <- c_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1457 y <- length(d_) - (ifelse(nrow(mtxdisdf_) >= 4, 4, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1458 d_ <- d_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1459 y <- length(e_) - (ifelse(nrow(mtxdisdf_) >= 5, 5, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1460 e_ <- e_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1461 y <- length(f_) - (ifelse(nrow(mtxdisdf_) >= 6, 6, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1462 f_ <- f_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1463 y <- length(g_) - (ifelse(nrow(mtxdisdf_) >= 7, 7, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1464 g_ <- g_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1465 y <- length(h_) - (ifelse(nrow(mtxdisdf_) >= 8, 8, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1466 h_ <- h_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1467 y <- length(i_) - (ifelse(nrow(mtxdisdf_) >= 9, 9, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1468 i_ <- i_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1469 y <- length(j_) - (ifelse(nrow(mtxdisdf_) >= 10, 10, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1470 j_ <- j_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1471 y <- length(k_) - (ifelse(nrow(mtxdisdf_) >= 11, 11, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1472 k_ <- k_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1473 y <- length(l_) - (ifelse(nrow(mtxdisdf_) >= 12, 12, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1474 l_ <- l_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1475 y <- length(m_) - (ifelse(nrow(mtxdisdf_) >= 13, 13, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1476 m_ <- m_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1477 y <- length(n_) - (ifelse(nrow(mtxdisdf_) >= 14, 14, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1478 n_ <- n_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1479 y <- length(o_) - (ifelse(nrow(mtxdisdf_) >= 15, 15, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1480 o_ <- o_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1481 y <- length(p_) - (ifelse(nrow(mtxdisdf_) >= 16, 16, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1482 p_ <- p_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1483 y <- length(q_) - (ifelse(nrow(mtxdisdf_) >= 17, 17, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1484 q_ <- q_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1485 y <- length(r_) - (ifelse(nrow(mtxdisdf_) >= 18, 18, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1486 r_ <- r_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1487 y <- length(s_) - (ifelse(nrow(mtxdisdf_) >= 19, 19, nrow(mtxdisdf_)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1488 s_ <- s_[1:y]
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1489
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1490 rm(y)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1491
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1492 name_ <- c(a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_, l_, m_, n_, o_, p_, q_, r_, s_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1493 df_ <- data.frame(expand.grid(mtxdis), name_[1:seq_len(nrow(expand.grid(mtxdis)))])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1494 names(df_) <- c("dist.", "name_")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1495
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1496 rm(a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_, l_, m_, n_, o_, p_, q_, r_, s_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1497 rm(name_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1498
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1499 q_ <- strsplit(df_$name_, " & ")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1500 mat_ <- matrix(unlist(q_), ncol = 2, byrow = TRUE)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1501 q_df_ <- as.data.frame(matrix(unlist(q_), ncol = 2, byrow = TRUE))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1502 df_ <- dplyr::bind_cols(df_, q_df_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1503
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1504 rm(q_, mat_, q_df_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1505
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1506 split_ <- strsplit(df_$V1, "_")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1507 v1_split_ <- as.data.frame(matrix(unlist(split_), ncol = 4, byrow = TRUE))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1508 split_ <- strsplit(df_$V2, "_")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1509 v2_split_ <- as.data.frame(matrix(unlist(split_), ncol = 4, byrow = TRUE))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1510
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1511 df_ <- dplyr::bind_cols(df_, v1_split_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1512 df_ <- dplyr::bind_cols(df_, v2_split_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1513 df_red_ <- subset(df_, V4...8 == V4...12 & V3...7 == V3...11)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1514 site_year_month_day <- rep(unique(qecbnato0_x$site_year_month_day), nrow(df_red_))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1515
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1516 df_red_ <- tibble::add_column(df_red_, site_year_month_day, .before = "dist.")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1517
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1518 rm(split_, v1_split_, v2_split_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1519 rm(mtxdis, mtxdisdf_, df_, site_year_month_day)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1520
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1521 matri_list[[x]] <- df_red_
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1522 matri_list <<- matri_list
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1523
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1524 rm(df_red_, qecbnato0_x, x)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1525
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1526 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1527
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1528 matri_df <- do.call("rbind", matri_list)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1529
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1530 names(matri_df) <- c("site_year_month_day", "dist.", "name_", "name_left", "name_right", "Type.Bloc.left", "Face.left", "Numéro.Bloc.échantillon.left", "Quadrat.left", "Type.Bloc.right", "Face.right", "Numéro.Bloc.échantillon.right", "Quadrat.right")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1531
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1532 matri_df <<- matri_df
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1533
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1534 hist(matri_df$dist.)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1535
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1536 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1537
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1538 data_ <- dplyr::filter(qecbnato0, Type.Bloc == "Bloc mobile")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1539 matri_list <- vector("list", length(unique(data_$site_year_month_day)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1540
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1541 matri_fct_bmm(data = data_, conca = c(bret_egmp_basq_qecb, egmp_basq_qecb))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1542 hist(matri_df$dist., main = c(paste("Histo. of Bray (0-adjusted) dist. dissimilarity measures"), paste(" (sqrt transfo) - BMfs vs BMfi -")))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1543
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1544 matri_full_bm_bf_fi <- matri_df
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1545
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1546 rm(data_, matri_df, matri_list)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1547
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1548
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1549 #############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1550 # #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1551 # Plot dissimilarity #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1552 # #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1553 #############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1554 ## plot
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1555
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1556 # activate line
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1557
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1558 matri_full_bm_bf_fs <- tidyr::separate(matri_full_bm_bf_fs, "site_year_month_day", into = c("departement", "Site", "Year", "Month", "Day"), remove = FALSE)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1559 matri_full_bm_bf_fs$Site <- paste0(matri_full_bm_bf_fs$departement, "_", matri_full_bm_bf_fs$Site)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1560 matri_full_bm_bf_fs <- subset(matri_full_bm_bf_fs, select = - c(departement))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1561
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1562 matri_full_bm_bf_fs <- tibble::add_column(matri_full_bm_bf_fs, Date = as.Date(paste0(matri_full_bm_bf_fs$Year, "-", matri_full_bm_bf_fs$Month, "-", matri_full_bm_bf_fs$Day), origin = "1970-01-01"), .after = "Site")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1563 matri_full_bm_bf_fs$Site <- as.factor(matri_full_bm_bf_fs$Site)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1564
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1565 matri_full_bm_bf_fi <- tidyr::separate(matri_full_bm_bf_fi, "site_year_month_day", into = c("departement", "Site", "Year", "Month", "Day"), remove = FALSE)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1566 matri_full_bm_bf_fi$Site <- paste0(matri_full_bm_bf_fi$departement, "_", matri_full_bm_bf_fi$Site)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1567 matri_full_bm_bf_fi <- subset(matri_full_bm_bf_fi, select = - c(departement))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1568 matri_full_bm_bf_fi <- tibble::add_column(matri_full_bm_bf_fi, Date = as.Date(paste0(matri_full_bm_bf_fi$Year, "-", matri_full_bm_bf_fi$Month, "-", matri_full_bm_bf_fi$Day), origin = "1970-01-01"), .after = "Site")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1569 matri_full_bm_bf_fi$Site <- as.factor(matri_full_bm_bf_fi$Site)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1570
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1571 # if error message "Error in .Call.graphics(C_palette2, .Call(C_palette2, NULL)) : invalid graphics state"
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1572
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1573
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1574 bf_fs_plot <- ggplot2::ggplot(matri_full_bm_bf_fs, ggplot2::aes(x = Site, y = dist.)) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1575 ggplot2::geom_boxplot() +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1576 #geom_jitter(shape = 16, position=position_jitter(0.2)) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1577 ggplot2::xlab("") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1578 ggplot2::ylab("distance diss. BM.BF_FS") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1579 ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90, vjust = 0.5, hjust = 1))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1580
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1581 ggplot2::ggsave("distance_diss_BF_FS.png", bf_fs_plot, height = 4.5, width = 4)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1582
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1583 fs_fi_plot <- ggplot2::ggplot(matri_full_bm_bf_fi, ggplot2::aes(x = Site, y = dist.)) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1584 ggplot2::geom_boxplot() +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1585 #geom_jitter(shape = 16, position=position_jitter(0.2)) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1586 ggplot2::xlab("") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1587 ggplot2::ylab("distance diss. BM_FS.FI") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1588 ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90, vjust = 0.5, hjust = 1))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1589
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1590 ggplot2::ggsave("distance_diss_FS_FI.png", fs_fi_plot, height = 4.5, width = 4)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1591
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1592 # issue with type de bloc, numéro de bloc and quadrat for df_ BM.BF_FS, cfr df_ left vs right variables doesn't give the right combination (variables with left vs right label in names come from the dissimilarity coefficient functions).
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1593 matri_full_bm_bf_fs$Quadrat <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1594 for (i in c(1:seq_len(nrow(matri_full_bm_bf_fs)))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1595 ifelse(matri_full_bm_bf_fs$Type.Bloc.left[i] == "Bloc mobile", matri_full_bm_bf_fs$Quadrat[i] <- matri_full_bm_bf_fs$Quadrat.left[i], matri_full_bm_bf_fs$Quadrat[i] <- matri_full_bm_bf_fs$Quadrat.right[i])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1596 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1597 matri_full_bm_bf_fs$Numéro.Bloc <- NA
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1598 for (i in c(1:seq_len(nrow(matri_full_bm_bf_fs)))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1599 ifelse(matri_full_bm_bf_fs$Type.Bloc.left[i] == "Bloc mobile", matri_full_bm_bf_fs$Numéro.Bloc[i] <- matri_full_bm_bf_fs$Numéro.Bloc.échantillon.left[i], matri_full_bm_bf_fs$Numéro.Bloc[i] <- matri_full_bm_bf_fs$Numéro.Bloc.échantillon.right[i])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1600 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1601
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1602 matri_full_bm_bf_fs <- tibble::add_column(matri_full_bm_bf_fs, site_year_month_day.q_BMnb = paste0(matri_full_bm_bf_fs$site_year_month_day, "_", matri_full_bm_bf_fs$Quadrat, "_", matri_full_bm_bf_fs$Numéro.Bloc), .after = "site_year_month_day")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1603 matri_full_bm_bf_fi <- tibble::add_column(matri_full_bm_bf_fi, site_year_month_day.q_BMnb = paste0(matri_full_bm_bf_fi$site_year_month_day, "_", matri_full_bm_bf_fi$Quadrat.left, "_", matri_full_bm_bf_fi$Numéro.Bloc.échantillon.left), .after = "site_year_month_day")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1604
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1605 colnames(matri_full_bm_bf_fs) <- paste("BM.BF_FS", colnames(matri_full_bm_bf_fs), sep = "_")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1606 matri_full_bm_bf_fs <- dplyr::rename(matri_full_bm_bf_fs, site_year_month_day.q_BMnb = BM.BF_FS_site_year_month_day.q_BMnb)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1607 colnames(matri_full_bm_bf_fi) <- paste("BM_FS.FI", colnames(matri_full_bm_bf_fi), sep = "_")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1608 matri_full_bm_bf_fi <- dplyr::rename(matri_full_bm_bf_fi, site_year_month_day.q_BMnb = BM_FS.FI_site_year_month_day.q_BMnb)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1609
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1610 matri_full <- dplyr::full_join(matri_full_bm_bf_fs[, c("site_year_month_day.q_BMnb", "BM.BF_FS_dist.")], matri_full_bm_bf_fi[, c("site_year_month_day.q_BMnb", "BM_FS.FI_dist.")])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1611
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1612 matri_full <- tidyr::separate(matri_full, "site_year_month_day.q_BMnb", into = c("departement", "Site", "Year", "Month", "Day", "Quadrat", "Bloc Mobile Number"), remove = FALSE)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1613 matri_full$Site <- paste0(matri_full$departement, "_", matri_full$Site)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1614 matri_full <- subset(matri_full, select = - c(departement))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1615 matri_full <- tibble::add_column(matri_full, Date = as.Date(paste0(matri_full$Year, "-", matri_full$Month, "-", matri_full$Day), origin = "1970-01-01"), .after = "Site")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1616
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1617 # Name for report/plot
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1618
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1619 matri_full <- tibble::add_column(matri_full, Site_bis = matri_full$Site, .after = "Site")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1620
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1621 matri_full$Site_bis <- ifelse(matri_full$Site == "GDMO_Locmariaquer", "Locmariaquer", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1622 matri_full$Site_bis <- ifelse(matri_full$Site == "GDMO_BegLann", "Beg Lann", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1623 matri_full$Site_bis <- ifelse(matri_full$Site == "FOUR_PlateauFour", "Plateau du Four", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1624 matri_full$Site_bis <- ifelse(matri_full$Site == "EGMP_GroinCou", "Groin du Cou", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1625 matri_full$Site_bis <- ifelse(matri_full$Site == "EGMP_PasEmsembert", "Le Pas d'Emsembert", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1626 matri_full$Site_bis <- ifelse(matri_full$Site == "EGMP_BreeBains", "La Brée-les-Bains", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1627 matri_full$Site_bis <- ifelse(matri_full$Site == "EGMP_PerreAntiochat", "Le Perré d'Antiochat", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1628 matri_full$Site_bis <- ifelse(matri_full$Site == "EGMP_Chassiron", "Chassiron", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1629 matri_full$Site_bis <- ifelse(matri_full$Site == "BASQ_FlotsBleusZP", "Les Flots Bleus / zone pêcheurs", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1630 matri_full$Site_bis <- ifelse(matri_full$Site == "BASQ_FlotsBleusZF", "Les Flots Bleus / zone familles", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1631 matri_full$Site_bis <- ifelse(matri_full$Site == "GONB_IlotStMichel", "Îlot Saint-Michel", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1632 matri_full$Site_bis <- ifelse(matri_full$Site == "FINS_Quemenes", "Quéménès", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1633 matri_full$Site_bis <- ifelse(matri_full$Site == "FINS_SeinGoulenez", "Île de Sein - Goulenez", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1634 matri_full$Site_bis <- ifelse(matri_full$Site == "FINS_SeinKilaourou", "Île de Sein - Kilaourou", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1635 matri_full$Site_bis <- ifelse(matri_full$Site == "ARMO_Verdelet", "Îlot du Verdelet", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1636 matri_full$Site_bis <- ifelse(matri_full$Site == "ARMO_Piegu", "Piégu", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1637 matri_full$Site_bis <- ifelse(matri_full$Site == "ARMO_Bilfot", "Pointe de Bilfot", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1638 matri_full$Site_bis <- ifelse(matri_full$Site == "ARMO_IlePlate", "Île Plate", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1639 matri_full$Site_bis <- ifelse(matri_full$Site == "PDMO_Perharidy", "Perharidy", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1640 matri_full$Site_bis <- ifelse(matri_full$Site == "BRES_Keraliou", "Keraliou", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1641 matri_full$Site_bis <- ifelse(matri_full$Site == "FINS_Mousterlin", "Pointe de Mousterlin", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1642 matri_full$Site_bis <- ifelse(matri_full$Site == "FINS_StNicolasGlenan", "Saint-Nicolas des Glénan", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1643 matri_full$Site_bis <- ifelse(matri_full$Site == "FINS_AnseRoz", "Pointe de l'Anse du Roz", matri_full$Site_bis)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1644
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1645 saveRDS(matri_full, "matri_full.RDS")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1646
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1647 #############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1648 # #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1649 # Plot the dissimilarity per site #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1650 # #
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1651 #############################################################
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1652 ## plot dissimilarity coefficient
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1653
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1654 matri_full$Year <- as.integer(matri_full$Year)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1655 matri_full$Month <- as.integer(matri_full$Month)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1656 matri_full$Day <- as.integer(matri_full$Day)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1657
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1658
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1659 ## BM_FS.FI_dist => mobile boulder upper vs lower faces
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1660
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1661 # Stats
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1662
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1663 bm_fs_fi_dist_stat <- matri_full %>% dplyr::group_by(Site, Site_bis, Date, Year, Month, Day) %>% dplyr::summarize(BM_FS.FI_dist.moy = mean(BM_FS.FI_dist., na.rm = TRUE), BM_FS.FI_dist.et = sd(BM_FS.FI_dist., na.rm = TRUE), BM_FS.FI_dist.med = median(BM_FS.FI_dist., na.rm = TRUE), BM_FS.FI_dist.min = min(BM_FS.FI_dist., na.rm = TRUE), BM_FS.FI_dist.max = max(BM_FS.FI_dist., na.rm = TRUE), nb. = dplyr::n(), nb.notNa = sum(!is.na(BM_FS.FI_dist.)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1664
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1665 bm_fs_fi_dist_stat <- dplyr::ungroup(bm_fs_fi_dist_stat)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1666
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1667 # Quality scale based on quartiles
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1668
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1669 if (choice == "N") {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1670 one <- round(mean(unlist(dplyr::filter(matri_full, BM_FS.FI_dist. <= quantile(matri_full$BM_FS.FI_dist., 0.25, na.rm = TRUE))["BM_FS.FI_dist."])), digits = 3)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1671 two <- round(mean(unlist(dplyr::filter(matri_full, BM_FS.FI_dist. > quantile(matri_full$BM_FS.FI_dist., 0.25, na.rm = TRUE) & BM_FS.FI_dist. <= quantile(matri_full$BM_FS.FI_dist., 0.5, na.rm = TRUE))["BM_FS.FI_dist."])), digits = 3)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1672 three <- round(mean(unlist(dplyr::filter(matri_full, BM_FS.FI_dist. > quantile(matri_full$BM_FS.FI_dist., 0.5, na.rm = TRUE) & BM_FS.FI_dist. <= quantile(matri_full$BM_FS.FI_dist., 0.75, na.rm = TRUE))["BM_FS.FI_dist."])), digits = 3)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1673 four <- round(mean(unlist(dplyr::filter(matri_full, BM_FS.FI_dist. > quantile(matri_full$BM_FS.FI_dist., 0.75, na.rm = TRUE))["BM_FS.FI_dist."])), digits = 3)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1674 }else {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1675 one <- 0.47
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1676 two <- 0.7
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1677 three <- 0.83
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1678 four <- 0.98
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1679 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1680
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1681 val_xmax <- as.Date(paste0(as.character(choice_date + 1), "-01-01"), origin = "1970-01-01")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1682
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1683 for (i in c(1:length(unique(bm_fs_fi_dist_stat$Site)))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1684
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1685 df1 <- dplyr::filter(bm_fs_fi_dist_stat, bm_fs_fi_dist_stat$Site == unique(bm_fs_fi_dist_stat$Site)[i])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1686
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1687 bm_fs_fi_plot <- ggplot2::ggplot() +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1688 ggplot2::geom_point(ggplot2::aes(x = bm_fs_fi_dist_stat$Date, y = bm_fs_fi_dist_stat$BM_FS.FI_dist.med), col = "grey") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1689 ggplot2::geom_rect(ggplot2::aes(xmin = as.Date("2013-01-01", origin = "1970-01-01"), xmax = val_xmax, ymin = - 0.1, ymax = one, fill = "blue"), alpha = 0.3) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1690 ggplot2::geom_rect(ggplot2::aes(xmin = as.Date("2013-01-01", origin = "1970-01-01"), xmax = val_xmax, ymin = one, ymax = two, fill = "green"), alpha = 0.3) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1691 ggplot2::geom_rect(ggplot2::aes(xmin = as.Date("2013-01-01", origin = "1970-01-01"), xmax = val_xmax, ymin = two, ymax = three, fill = "yellow"), alpha = 0.3) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1692 ggplot2::geom_rect(ggplot2::aes(xmin = as.Date("2013-01-01", origin = "1970-01-01"), xmax = val_xmax, ymin = three, ymax = four, fill = "orange"), alpha = 0.3) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1693 ggplot2::geom_rect(ggplot2::aes(xmin = as.Date("2013-01-01", origin = "1970-01-01"), xmax = val_xmax, ymin = four, ymax = 1.1, fill = "red"), alpha = 0.3) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1694 ggplot2::scale_fill_manual(values = c("#FF0000", "#F59404", "#18E125", "#1A1AE8", "#FAFA15")) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1695 ggplot2::geom_pointrange(ggplot2::aes(x = df1$Date, y = df1$BM_FS.FI_dist.med, ymin = df1$BM_FS.FI_dist.min, ymax = df1$BM_FS.FI_dist.max), col = "black") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1696 ggplot2::xlab("Date") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1697 ggplot2::ylab("Coef dissim BM FS-FI") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1698 ggplot2::ggtitle(unique(df1$Site_bis)) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1699 ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90, vjust = 0.5, hjust = 1), legend.position = "none")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1700
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1701 ggplot2::ggsave(paste0("fs_fi_", df1$Site, ".png"), device = "png", bm_fs_fi_plot, height = 3, width = 3.5)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1702
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1703 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1704
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1705 rm(df1, four, i, one, three, two, xmax_, xmin_, ymax_, ymin_)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1706
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1707
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1708 ## BM.BF_FS_dist => mobile boulder vs fixed boulder upper faces
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1709
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1710 # Stats
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1711
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1712 bm_bf_fs_dist_stat <- matri_full %>% dplyr::group_by(Site, Site_bis, Date, Year, Month, Day) %>% dplyr::summarize(BM.BF_FS_dist.moy = mean(BM.BF_FS_dist., na.rm = TRUE), BM.BF_FS_dist.et = sd(BM.BF_FS_dist., na.rm = TRUE), BM.BF_FS_dist.med = median(BM.BF_FS_dist., na.rm = TRUE), BM.BF_FS_dist.min = min(BM.BF_FS_dist., na.rm = TRUE), BM.BF_FS_dist.max = max(BM.BF_FS_dist., na.rm = TRUE), nb. = dplyr::n(), nb.notNa = sum(!is.na(BM.BF_FS_dist.)))
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1713
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1714 bm_bf_fs_dist_stat <- dplyr::ungroup(bm_bf_fs_dist_stat)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1715
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1716 # Quality scale based on quartiles
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1717
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1718 if (choice == "N") {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1719 one <- round(mean(unlist(dplyr::filter(matri_full, BM.BF_FS_dist. <= quantile(matri_full$BM.BF_FS_dist., 0.25, na.rm = TRUE))["BM.BF_FS_dist."])), digits = 3)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1720 two <- round(mean(unlist(dplyr::filter(matri_full, BM.BF_FS_dist. > quantile(matri_full$BM.BF_FS_dist., 0.25, na.rm = TRUE) & BM.BF_FS_dist. <= quantile(matri_full$BM.BF_FS_dist., 0.5, na.rm = TRUE))["BM.BF_FS_dist."])), digits = 3)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1721 three <- round(mean(unlist(dplyr::filter(matri_full, BM.BF_FS_dist. > quantile(matri_full$BM.BF_FS_dist., 0.5, na.rm = TRUE) & BM.BF_FS_dist. <= quantile(matri_full$BM.BF_FS_dist., 0.75, na.rm = TRUE))["BM.BF_FS_dist."])), digits = 3)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1722 four <- round(mean(unlist(dplyr::filter(matri_full, BM.BF_FS_dist. > quantile(matri_full$BM.BF_FS_dist., 0.75, na.rm = TRUE))["BM.BF_FS_dist."])), digits = 3)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1723
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1724 }else {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1725 one <- 0.19
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1726 two <- 0.32
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1727 three <- 0.455
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1728 four <- 0.735
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1729 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1730 # Plot
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1731
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1732 for (i in c(1:length(unique(bm_bf_fs_dist_stat$Site)))) {
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1733
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1734 df1 <- dplyr::filter(bm_bf_fs_dist_stat, bm_bf_fs_dist_stat$Site == unique(bm_bf_fs_dist_stat$Site)[i])
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1735
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1736 bm_bf_fs_plot <- ggplot2::ggplot() +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1737 ggplot2::geom_point(ggplot2::aes(x = bm_bf_fs_dist_stat$Date, y = bm_bf_fs_dist_stat$BM.BF_FS_dist.med), col = "grey") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1738 ggplot2::geom_rect(ggplot2::aes(xmin = as.Date("2013-01-01", origin = "1970-01-01"), xmax = val_xmax, ymin = - 0.1, ymax = one, fill = "red"), alpha = 0.3) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1739 ggplot2::geom_rect(ggplot2::aes(xmin = as.Date("2013-01-01", origin = "1970-01-01"), xmax = val_xmax, ymin = one, ymax = two, fill = "orange"), alpha = 0.3) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1740 ggplot2::geom_rect(ggplot2::aes(xmin = as.Date("2013-01-01", origin = "1970-01-01"), xmax = val_xmax, ymin = two, ymax = three, fill = "yellow"), alpha = 0.3) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1741 ggplot2::geom_rect(ggplot2::aes(xmin = as.Date("2013-01-01", origin = "1970-01-01"), xmax = val_xmax, ymin = three, ymax = four, fill = "green"), alpha = 0.3) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1742 ggplot2::geom_rect(ggplot2::aes(xmin = as.Date("2013-01-01", origin = "1970-01-01"), xmax = val_xmax, ymin = four, ymax = 1.1, fill = "blue"), alpha = 0.3) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1743 ggplot2::scale_fill_manual(values = c("#FF0000", "#F59404", "#18E125", "#1A1AE8", "#FAFA15")) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1744 ggplot2::geom_pointrange(ggplot2::aes(x = df1$Date, y = df1$BM.BF_FS_dist.med, ymin = df1$BM.BF_FS_dist.min, ymax = df1$BM.BF_FS_dist.max), col = "black") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1745 ggplot2::xlab("Date") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1746 ggplot2::ylab("Coef dissim BM-BF FS") +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1747 ggplot2::ggtitle(unique(df1$Site_bis)) +
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1748 ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90, vjust = 0.5, hjust = 1), legend.position = "none")
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1749
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1750 ggplot2::ggsave(paste0("bm_bf_", df1$Site, ".png"), device = "png", bm_bf_fs_plot, height = 3, width = 3.5)
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1751
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1752 }
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1753
42b51a52e308 planemo upload for repository https://github.com/Marie59/champ_blocs commit 0d86db7d42b608c386a54500064f5f9c9d7019a4
ecology
parents:
diff changeset
1754 rm(df1, four, i, one, three, two, xmax_, xmin_, ymax_, ymin_)