# -*- coding: utf-8 -*-
#====== uso interno =======
#' length
#' @description vector has length equal zero
#' @param x vector
#' @return logical
#' @keywords internal
is_vacuo <- function(x) {
length(x) == 0L
}
#' length
#' @description vector has length equal zero
#' @param x vector
#' @return logical
#' @keywords internal
is_empty <- function(x) {
length(x) == 0L
}
#' Escalar
#' @description Es vector con un elemento?
#' @param x vector
#' @return logical
#' @keywords internal
is_scalar <- function(x) {
length(x) == 1L
}
#' Escalar
#' @description Es vector vacío o con un elemento?
#' @param x vector
#' @return logical
#' @keywords internal
is_scalar0 <- function(x) {
length(x) <= 1L
}
#' length
#' @description vector has length greater than zero?
#' @param x vector
#' @return logical
#' @keywords internal
#' @author eddy castellón
filled <- function(x) {
length(x) > 0L
}
#' character type
#' @description vector is of character type and has elements?
#' @param x vector
#' @return logical
#' @keywords internal
filled_char <- function(x) {
is.character(x) && length(x)
}
#' numeric mode
#' @description vector is of numeric mode and has elements?
#' @param x vector
#' @return logical
#' @keywords internal
filled_num <- function(x) {
is.numeric(x) && length(x)
}
#' integer type
#' @description vector is of integer type and has elements?
#' @param x vector
#' @return logical
#' @keywords internal
filled_int <- function(x) {
is.integer(x) && length(x)
}
#' logical type
#' @description vector is of logical type and has elements?
#' @param x vector
#' @return logical
#' @keywords internal
filled_log <- function(x) {
is.logical(x) && length(x)
}
#' list-no-vac
#' @description vector is list and has elements?
#' @param x vector
#' @return logical
#' @keywords internal
filled_list <- function(x) {
is.list(x) && length(x)
}
#' valida-name
#' @description Valida nombre de variable
#' @param x vector
#' @return logical
#' @keywords internal
is_name <- function(x) {
length(x) && identical(x, make.names(x))
}
#' nombre-scalar
#' @description Valida nombre escalar
#' @param x vector
#' @return logical
#' @keywords internal
is_scalar_name <- function(x) {
length(x) == 1L && identical(x, make.names(x))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.