Last active
November 29, 2023 14:16
-
-
Save benilton/0dc6ba5cca969ffc0da564e8160a51bf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
## Instalação r2u | |
shell_call <- function(command, ...) { | |
result <- system(command, intern = TRUE, ...) | |
cat(paste0(result, collapse = "\n")) | |
} | |
download.file("https://github.com/eddelbuettel/r2u/raw/master/inst/scripts/add_cranapt_jammy.sh", | |
"add_cranapt_jammy.sh") | |
Sys.chmod("add_cranapt_jammy.sh", "0755") | |
shell_call("./add_cranapt_jammy.sh") | |
bspm::enable() | |
options(bspm.version.check=FALSE) | |
shell_call("rm add_cranapt_jammy.sh") | |
## Preparando acesso ao Google Drive | |
loadPackages = function(pkgs){ | |
myrequire = function(...){ | |
suppressWarnings(suppressMessages(suppressPackageStartupMessages(require(...)))) | |
} | |
ok = sapply(pkgs, require, character.only=TRUE, quietly=TRUE) | |
if (!all(ok)){ | |
message("There are missing packages: ", paste(pkgs[!ok], collapse=", ")) | |
install.packages(pkgs[!ok]) | |
loadPackages(pkgs[!ok]) | |
} | |
} | |
loadPackages(c("googledrive", "httpuv", "R.utils", "httr")) | |
my_check = function() TRUE | |
reassignInPackage("is_interactive", pkgName="httr", my_check) | |
options(rlang_interactive=TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment