#' trackJR_summ
#' @description Generate a simple summary for each `boxes` solving how many points are in the box?.
#' @param data_trackJR The data frame with columns "fr", "x" and "y" generated by the `trackJR` function.
#' @param boxes a Lit of The boxes names generated by the `trackJR_box` function.
#' @param var_names a List variable names to call the boxes.
#'
#' @return It return a data.frame with the count of point in each boxes.
#' @export
#'
#' @examples
#'mypathDirandFile<-"C:/Users/test/vid.mp4"
#' dataT<-trackJR(mypathDirandFile)
#' graf<-trackJR_ggplot(mypathDirandFile,dataT)
#' trackJR_box(graf,"box1")
#' trackJR_box(graf,"box2")
#' trackJR_box(graf,"box3")
#'
#' summaryData<- trackJR_summ (dataT,list(box1,box2,box3),list("estimuli","control","blank"))
#'
trackJR_summ<-function (data_trackJR,boxes=NULL,var_names=NULL){
xbox <- boxes
xvar<- unlist(var_names)
summa<-data.frame(var=character(0))
if(length(xbox)!=length(xvar)){
cat("number of boxes differ from number of variables names \n")
stop()
}
for(i in 1:length(xbox)+1){
summa[1,1]<-"frames"
summa[1,i]<-nrow(trackJR_pbox(data_trackJR,xbox[[i-1]]))
}
colnames(summa)[1:length(xbox)+1]<-(xvar)
return(summa)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.