-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/drdsdaniel/Dmisc
- Loading branch information
Showing
11 changed files
with
151 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export("%...>%") | ||
export("%<...%") | ||
export("%>%") | ||
export("%T>%") | ||
export(":=") | ||
export(cut3) | ||
export(cut3_quantile) | ||
export(describe) | ||
export(instalar_paquete_si_falta) | ||
export(vars_to_date) | ||
importFrom(lifecycle,deprecate_soft) | ||
importFrom(lifecycle,deprecate_warn) | ||
importFrom(lifecycle,deprecated) | ||
importFrom(magrittr,"%>%") | ||
importFrom(magrittr,"%T>%") | ||
importFrom(rlang,":=") | ||
importFrom(utils,install.packages) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#' Instalar un paquete si no esta presente | ||
#' | ||
#' Esta función verifica si un paquete de R esta instalado. Si no lo esta, | ||
#' pregunta al usuario si desea instalarlo. Si el usuario responde afirmativamente, | ||
#' instala el paquete. Si el usuario responde negativamente, la función se detiene | ||
#' y muestra un mensaje indicando que el paquete es necesario. | ||
#' | ||
#' @param nombre_del_paquete El nombre del paquete que se quiere verificar e instalar. | ||
#' | ||
#' @return Invisible NULL. La función se utiliza principalmente por sus efectos | ||
#' secundarios (instalación de paquetes), y no devuelve ningún valor. | ||
#' @export | ||
#' | ||
#' @importFrom utils install.packages | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' instalar_paquete_si_falta("dplyr") | ||
#' } | ||
instalar_paquete_si_falta <- function(nombre_del_paquete) { | ||
if (!requireNamespace(nombre_del_paquete, quietly = TRUE)) { | ||
mensaje <- paste("El paquete", nombre_del_paquete, "no esta instalado. Desea instalarlo ahora? (y/n)") | ||
respuesta <- readline(prompt = mensaje) | ||
|
||
if (tolower(respuesta) == "y") { | ||
install.packages(nombre_del_paquete) | ||
} else { | ||
stop(paste("El paquete", nombre_del_paquete, "es necesario y no esta instalado.")) | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.