Skip to content

Commit cce36c0

Browse files
committed
updt web
1 parent 0c0b2f5 commit cce36c0

3 files changed

Lines changed: 85 additions & 88 deletions

File tree

docs/pkgdown.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pandoc: '3.4'
1+
pandoc: 3.6.3
22
pkgdown: 2.1.3
33
pkgdown_sha: ~
44
articles:
@@ -9,7 +9,7 @@ articles:
99
tarpuy: tarpuy.html
1010
extra/yupana-coding: extra/yupana-coding.html
1111
yupana: yupana.html
12-
last_built: 2025-06-23T02:30Z
12+
last_built: 2025-07-31T22:09Z
1313
urls:
1414
reference: https://inkaverse.com/reference
1515
article: https://inkaverse.com/articles

docs/setup.r

Lines changed: 60 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,84 @@
11
# -------------------------------------------------------------------------
2-
# R packages dependencies and configuration -------------------------------
2+
# 📄 R packages dependencies and configuration ----------------------------
33
# -------------------------------------------------------------------------
4-
#> author .: Flavio Lozano-Isla (linkedin.com/in/flozanoisla/)
5-
#> date .: 2025-05-16
4+
#> Author .: Flavio Lozano-Isla (linkedin.com/in/flozanoisla/)
5+
#> Date .: 2025-07-23
66
# -------------------------------------------------------------------------
77

8-
#> source("https://inkaverse.com/setup.r")
8+
# Optional: external setup script
9+
# source("https://inkaverse.com/setup.r")
910

1011
# -------------------------------------------------------------------------
11-
# Packages ----------------------------------------------------------------
12+
# 📦 Package loading and installation -------------------------------------
1213
# -------------------------------------------------------------------------
1314

14-
cran <- c(
15-
"devtools" # Developer tools
16-
, "inti" # Tools and Statistical Procedures in Plant Science
17-
, "FactoMineR" # Multivariate data analysis
18-
, "psych" # Correlation plot
19-
, "lme4"
20-
, "car"
21-
, "emmeans"
22-
, "multcomp"
23-
, "huito" # label design
24-
, "grid" # Import images as R object
25-
, "googlesheets4" # Read/write google sheets docs
26-
, "googledrive" # Download/Upload files from googledrive
27-
, "knitr" # Write docs using R
28-
, "tidyverse" # Data manipulation
29-
)
30-
31-
# git <- c("crsh/citr") # Use zotero for docs citations
32-
33-
suppressPackageStartupMessages({
34-
35-
for (pkg in cran) {
36-
if( !require(pkg, character.only = TRUE) ) {
15+
cran_packages <- c(
16+
"devtools", "tidyverse"
17+
, "lme4", "car", "emmeans", "multcomp"
18+
, "FactoMineR", "psych"
19+
, "inti", "huito"
20+
, "googlesheets4", "googledrive"
21+
, "knitr", "grid", "magick"
22+
, "RhpcBLASctl"
23+
, "sessioninfo"
24+
)
25+
26+
load_or_install <- function(pkgs) {
27+
for (pkg in pkgs) {
28+
if (!requireNamespace(pkg, quietly = TRUE)) {
3729
install.packages(pkg)
38-
library(pkg, character.only = TRUE)
39-
}
30+
}
31+
suppressPackageStartupMessages(library(pkg, character.only = TRUE))
4032
}
41-
42-
# for (pkg in git) {
43-
# if( !require(sub(".*/", "", pkg), character.only = T) ) {
44-
# devtools::install_github(pkg, upgrade = T)
45-
# library(sub(".*/", "", pkg), character.only = T)
46-
# }
47-
# }
48-
49-
})
50-
51-
remove(cran
52-
# , git
53-
, pkg)
33+
}
34+
35+
load_or_install(cran_packages)
5436

5537
# -------------------------------------------------------------------------
56-
# Knitr options -----------------------------------------------------------
38+
# ⚙️ System and computation configuration ----------------------------------
5739
# -------------------------------------------------------------------------
5840

5941
knitr::opts_chunk$set(
60-
fig.align = "center" # Center images in the export file
61-
, out.width = "98%" # Figure width in html
62-
# , echo = FALSE # Avoid print code in the export file
63-
, message = FALSE # Avoid print messages in the export file
64-
, warning = FALSE # Avoid print warnings in the export file
65-
, collapse = TRUE # Collapse text output into source blocks
42+
fig.align = "center",
43+
out.width = "98%",
44+
message = FALSE,
45+
warning = FALSE,
46+
collapse = TRUE
6647
)
6748

68-
# -------------------------------------------------------------------------
69-
# Compile options ---------------------------------------------------------
70-
# -------------------------------------------------------------------------
71-
7249
options(
73-
OutDec= "." # Use "." instead of "," in the decimal values
74-
, scipen = 99 # Avoid use "6e-04"
75-
, knitr.kable.NA = "" # NA values will appear as empty cell
76-
, knitr.table.format = "pipe" # Format for export tables
77-
, citr.use_betterbiblatex = FALSE # For zotero addin
78-
)
50+
OutDec = ".", scipen = 99,
51+
knitr.kable.NA = "",
52+
knitr.table.format = "pipe",
53+
citr.use_betterbiblatex = FALSE
54+
)
55+
56+
# CPU configuration
57+
total_cores <- parallel::detectCores(logical = TRUE)
58+
usable_cores <- max(1, floor(total_cores * 0.8))
59+
RhpcBLASctl::blas_set_num_threads(usable_cores)
7960

8061
# -------------------------------------------------------------------------
81-
# Authorize googledrive & googlesheets ------------------------------------
62+
# 🔐 Google authentication ------------------------------------------------
8263
# -------------------------------------------------------------------------
8364

8465
googlesheets4::gs4_auth(TRUE)
8566
googledrive::drive_auth(TRUE)
67+
68+
# -------------------------------------------------------------------------
69+
# 📋 Environment info -----------------------------------------------------
70+
# -------------------------------------------------------------------------
71+
72+
# Mostrar ruta del proyecto y número de núcleos
73+
cat("Project directory: ", getwd(), "\n")
74+
cat("CPU cores detected: ", total_cores, "\n")
75+
cat("CPU cores in use: ", usable_cores, "\n")
76+
77+
# Información de sesión
78+
sessioninfo::session_info() %>% print()
79+
80+
# -------------------------------------------------------------------------
81+
# 🧹 Clean up -------------------------------------------------------------
82+
# -------------------------------------------------------------------------
83+
84+
rm(cran_packages, load_or_install, total_cores, usable_cores)

pkgdown/favicon/setup.r

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
# -------------------------------------------------------------------------
2-
# R packages dependencies and configuration -------------------------------
2+
# 📄 R packages dependencies and configuration ----------------------------
33
# -------------------------------------------------------------------------
4-
#> author .: Flavio Lozano-Isla (linkedin.com/in/flozanoisla/)
5-
#> date .: 2025-07-23
4+
#> Author .: Flavio Lozano-Isla (linkedin.com/in/flozanoisla/)
5+
#> Date .: 2025-07-23
66
# -------------------------------------------------------------------------
77

8-
#> source("https://inkaverse.com/setup.r")
8+
# Optional: external setup script
9+
# source("https://inkaverse.com/setup.r")
910

1011
# -------------------------------------------------------------------------
1112
# 📦 Package loading and installation -------------------------------------
1213
# -------------------------------------------------------------------------
1314

1415
cran_packages <- c(
15-
"devtools", "inti", "FactoMineR", "psych", "lme4", "car", "emmeans",
16-
"multcomp", "huito", "grid", "googlesheets4", "googledrive",
17-
"knitr", "tidyverse", "RhpcBLASctl", "sessioninfo", "cli"
16+
"devtools", "tidyverse"
17+
, "lme4", "car", "emmeans", "multcomp"
18+
, "FactoMineR", "psych"
19+
, "inti", "huito"
20+
, "googlesheets4", "googledrive"
21+
, "knitr", "grid", "magick"
22+
, "RhpcBLASctl"
23+
, "sessioninfo"
1824
)
1925

2026
load_or_install <- function(pkgs) {
@@ -28,16 +34,6 @@ load_or_install <- function(pkgs) {
2834

2935
load_or_install(cran_packages)
3036

31-
# Optional GitHub packages
32-
# git_packages <- c("crsh/citr")
33-
# for (repo in git_packages) {
34-
# pkg <- sub(".*/", "", repo)
35-
# if (!requireNamespace(pkg, quietly = TRUE)) {
36-
# devtools::install_github(repo, upgrade = TRUE)
37-
# }
38-
# suppressPackageStartupMessages(library(pkg, character.only = TRUE))
39-
# }
40-
4137
# -------------------------------------------------------------------------
4238
# ⚙️ System and computation configuration ----------------------------------
4339
# -------------------------------------------------------------------------
@@ -57,30 +53,32 @@ options(
5753
citr.use_betterbiblatex = FALSE
5854
)
5955

56+
# CPU configuration
6057
total_cores <- parallel::detectCores(logical = TRUE)
6158
usable_cores <- max(1, floor(total_cores * 0.8))
6259
RhpcBLASctl::blas_set_num_threads(usable_cores)
6360

64-
cli::cli_alert_info("📁 Project directory: {getwd()}")
65-
cli::cli_alert_info("🧠 Total CPU cores detected: {total_cores}")
66-
cli::cli_alert_info("🚀 BLAS threads configured to: {RhpcBLASctl::blas_get_num_threads()}")
67-
6861
# -------------------------------------------------------------------------
6962
# 🔐 Google authentication ------------------------------------------------
7063
# -------------------------------------------------------------------------
7164

72-
googlesheets4::gs4_auth(cache = ".secrets", use_oob = TRUE)
73-
googledrive::drive_auth(cache = ".secrets", use_oob = TRUE)
65+
googlesheets4::gs4_auth(TRUE)
66+
googledrive::drive_auth(TRUE)
7467

7568
# -------------------------------------------------------------------------
7669
# 📋 Environment info -----------------------------------------------------
7770
# -------------------------------------------------------------------------
7871

79-
sessioninfo::session_info()
72+
# Mostrar ruta del proyecto y número de núcleos
73+
cat("Project directory: ", getwd(), "\n")
74+
cat("CPU cores detected: ", total_cores, "\n")
75+
cat("CPU cores in use: ", usable_cores, "\n")
76+
77+
# Información de sesión
78+
sessioninfo::session_info() %>% print()
8079

8180
# -------------------------------------------------------------------------
8281
# 🧹 Clean up -------------------------------------------------------------
8382
# -------------------------------------------------------------------------
8483

8584
rm(cran_packages, load_or_install, total_cores, usable_cores)
86-
# rm(git_packages) # if defined

0 commit comments

Comments
 (0)