Mercurial > repos > ecology > ecology_stat_presence_abs
comparison functions.r @ 1:9a2e0195bb43 draft default tip
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
author | ecology |
---|---|
date | Fri, 13 Aug 2021 18:18:21 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:e5552099d0e3 | 1:9a2e0195bb43 |
---|---|
1 #Rscript | |
2 | |
3 ######################################################################################### | |
4 ####################### Exploration data tools function ################################# | |
5 ######################################################################################### | |
6 #### Based on Romain Lorrillière R script | |
7 #### Modified by Alan Amosse, Benjamin Yguel and Marie Jossé for integrating within Galaxy-E | |
8 | |
9 ######################################### start of the function makeTableAnalyse | |
10 ##Species are placed in separated columns and addition of zero on plots where at least one selected species is present | |
11 make_table_analyse <- function(data, var, spe, var2, var3) { | |
12 tab <- reshape(data | |
13 , v.names = var | |
14 , idvar = c(var2, var3) | |
15 , timevar = spe | |
16 , direction = "wide") | |
17 tab[is.na(tab)] <- 0 ###### remplace les na par des 0 / replace NAs by 0 | |
18 | |
19 colnames(tab) <- sub(paste0(var, "."), "", colnames(tab))### remplace le premier pattern "abond." par le second "" / replace the column names "abond." by "" | |
20 return(tab) | |
21 } | |
22 ######################################### end of the function makeTableAnalyse |