MaxBacteriaPred {CoDaLoMic} | R Documentation |
Putting the reference bacteria at the last row
Description
This function calculates the mean abundance of each bacteria taking into account the time points used to estimate the model (t=1,2,...,Tt
). Then, it creates a matrix where each row contains the abundance of one bacteria at all time points but the bacteria with maximum (or minimum) mean abundance (or the bacterial indicated by the user) is placed at the last row
Usage
MaxBacteriaPred(
nombresOriginal,
especieOriginal,
E,
Tt,
Pred,
K,
especieOriginal.All,
which.esp
)
Arguments
nombresOriginal |
Vector with the bacterial names at the same order than in DaTa. it must be fulfilled that lenght(nombresOriginal)==dim(DaTa)[2]-1 |
especieOriginal |
Matrix that contains at row i the bacterial taxa of bacteria i at t=1,2,..., |
E |
Number of bacteria available |
Tt |
Number of time points used to estimate the model ( |
Pred |
Number. The data at t=1,...,Pred-1 will be used to estimate the model. The rest of the time points will be used to study the capacity of the model to predict. If |
K |
Number of time points at the data |
especieOriginal.All |
Matrix that contains at row i the bacterial taxa of bacteria i at all time points. |
which.esp |
If |
Value
Returns a list with
-
especie
- Matrix that contains at row i the bacterial taxa of bacteria i at time points t=1,2,...,Tt
but the bacteria with with maximum (or minimum) mean abundance (or the bacteria indicated by the user) is placed at the last row. -
especiemodi
- Matrix that contains at row i the bacterial taxa of bacteria i at time points t=2,...,Tt
but the bacteria with with maximum (or minimum) mean abundance (or the bacteria indicated by the user) is placed at the last row. -
nombres
- Vector with the bacteria's names placed in the order in which appear in the rows of the matricesespecie
andespeciemodi
-
EE
- Row in which the bacterial with maximum (or minimum) mean abundance was (or the value of "which" if which is numerical). -
EspecieMaxima
- Row in which the bacterial with with maximum (or minimum) mean abundance (or the bacteria indicated by the user) is inespecie
.) #' #' -
especie.all
- Matrix that contains at row i the bacterial taxa of bacteria i at all time points (t=1,2,...,K) but the bacteria with with maximum (or minimum) mean abundance (or the bacteria indicated by the user) is placed at the last row. -
especiemodi.all
- Matrix that contains at row i the bacterial taxa of bacteria i at all time points (t=2,...,K) but the bacteria with with maximum (or minimum) mean abundance (or the bacteria indicated by the user) is placed at the last row.
Examples
names2=c("Bact1","Bact2","Bact3","Bact4","Bact5")
set.seed(314)
esp2=t(gtools::rdirichlet(n=6, c(1,1,5,1,1)))
e2=5
MaxBacteriaPred(names2,esp2[,-c(4,5,6)],e2,3,Pred=4, 6,esp2, "Max")