#' Are all numerics the same?
#'
#' Test whether all numerics in a vector are the same.
#' @param x A numeric vector
#' @export
allNumericsTheSame = function(x){
## x is a numeric vector
# not dealing with vectors having NAs
stopifnot(!any(is.na(x)))
if(max(x) - min(x) == 0){
return(T)
}
else {
return(F)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.