#' Print crowsample
#'
#' @param x
#' @param ...
#'
#' @return
#' @export
#'
#' @examples
print.crowdsample <- function(x, ...){
cat("\n Sample simulation")
cat("\n Method: ", x$method, "\n")
print(round(c("HTest"= x$Htest, "Variance"= x$var_Htest), 5))
}
#' Summary crowdsample
#'
#' @param x
#' @param ...
#'
#' @return
#' @export
#'
#' @examples
summary.crowdsample <- function(x, ...){
cat("\n Sample simulation")
cat("\n Method: ", x$method, "\n")
print(cbind("HTest"= x$Htest, "Variance"= x$var_Htest))
cat("\n Simulations detail \n")
print(cbind("HTest"= x$Htest_vec, "Variance"= x$var_Htest_vec))
}
#' Plot crowdsample
#'
#' @param x
#' @param ...
#'
#' @return
#' @export
#'
#' @examples
plot.crowdsample <- function(x, ...){
sample_strat_id <- which(unlist(x$model$y) %in% unlist(x$y_sample))
plot(x$model$coord, main=x$method, ...)
points(x$model$coord[sample_strat_id, ], pch=16, col="red")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.