Skip to contents

This function computes the Synchronised MaxN (SmaxN) for a set on n cameras with know distances between them and for a given species which maximal speed is known.

Usage

SmaxN.computation(abund_df, speed, dist_df)

Arguments

abund_df

a numerical dataframe containing the abundance of a given species across continuous time for several cameras. The columns refer to the cameras and the rows refers to the time. Time must be given in seconds and be continuous. BE CAREFUL that the cameras are in the same order in the abund_df and the time_df!.

speed

a numerical value refering to the maximal speed of the studied species. Speed must be given in meters per second. If the computation of maxN values should not take into account speed (that is to say if the camera pooling is done at the second level), fish_speed = NULL

dist_df

a numerical dataframe containing the distance between each pair of camera. There are as many rows as there are cameras and there are as many columns as there are cameras, thus the dataframe is symmetrical and the diagonal is filled with 0. Rows names and columns names must be cameras names. BE CAREFUL that the cameras are the same and in the same order in the dist_df and in the abund_df!

Value

if more than one camera: if the fish speed is taken into account, the function returns in a list: the Synchronised maxN (SmaxN) value (the maximal value computed by gathering temporally synchronised cameras) , the maxN value

(the maximal value computed as the maximal abundance across all cameras and timesteps) , the maxN_cam values (a vector of maximal values for each camera, thus the list contains as many elements as there are cameras) , the maxN_tiemstep values (a vector of maximal values for each row by taking the maximal value of cameras abundances on each row, thus the list contains as many elements as there are rows in the abund_df dataframe) and the SmaxN_timestep value (the maximal value of the abundances summed across cameras on each row). If fish speed is not taken into account then, the returned list does not contain the SmaxN value because the SmaxN value is the equal to the SmaxN_row value. if only one camera: the function returns only the maxN value

(the maximal value computed as the maximal abundance across all timesteps)

Examples

 # Build distance dataframe for the example:
 dist_df_ex <- data.frame("A" = c(0, 2, 5, 5), "B" = c(2, 0, 5, 5), 
 "C" = c(5, 5, 0, 4), "D" = c(5, 5, 4, 0))
 rownames(dist_df_ex) <- c("A", "B", "C", "D")
 # Build distance dataframe for the example:
 abund_df_ex <- data.frame("A" = c(0, 1, 3, 7, 2, 2, 3, 0, 6, 2, 0, 1), 
                           "B" = c(2, 2, 2, 2, 0, 0, 0, 0, 8, 2, 1, 0), 
                           "C" = c(2, 0, 1, 0, 0, 4, 2, 2, 3, 0, 0, 4), 
                           "D" = c(0, 1, 0, 1, 0, 6, 1, 1, 6, 4, 2, 1))