Skip to content

Commit b3f3ca8

Browse files
committed
cleanup examples, update metadata
1 parent 6968828 commit b3f3ca8

21 files changed

Lines changed: 274 additions & 148 deletions

.Rbuildignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
^docs$
99
^pkgdown$
1010
^\.github$
11+
^\.sync$
1112
^\.Rprofile$
1213
^rjavaenv$
1314
^private$
@@ -33,3 +34,5 @@
3334
^\.jupyter$
3435
^[.]?air[.]toml$
3536
^\.vscode$
37+
^\.devcontainer$
38+
^\.claude$

CITATION.cff

Lines changed: 115 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ references:
8181
institution:
8282
name: R Foundation for Statistical Computing
8383
address: Vienna, Austria
84-
year: '2025'
84+
year: '2026'
8585
version: '>= 4.0'
8686
- type: software
8787
title: checkmate
@@ -94,7 +94,7 @@ references:
9494
given-names: Michel
9595
email: michellang@gmail.com
9696
orcid: https://orcid.org/0000-0001-9754-0393
97-
year: '2025'
97+
year: '2026'
9898
doi: 10.32614/CRAN.package.checkmate
9999
- type: software
100100
title: cli
@@ -106,7 +106,7 @@ references:
106106
- family-names: Csárdi
107107
given-names: Gábor
108108
email: gabor@posit.co
109-
year: '2025'
109+
year: '2026'
110110
doi: 10.32614/CRAN.package.cli
111111
- type: software
112112
title: curl
@@ -119,21 +119,64 @@ references:
119119
given-names: Jeroen
120120
email: jeroenooms@gmail.com
121121
orcid: https://orcid.org/0000-0002-4035-0289
122-
year: '2025'
122+
year: '2026'
123123
doi: 10.32614/CRAN.package.curl
124124
- type: software
125-
title: jsonlite
126-
abstract: 'jsonlite: A Simple and Robust JSON Parser and Generator for R'
125+
title: digest
126+
abstract: 'digest: Create Compact Hash Digests of R Objects'
127127
notes: Imports
128-
url: https://jeroen.r-universe.dev/jsonlite
129-
repository: https://CRAN.R-project.org/package=jsonlite
128+
url: https://eddelbuettel.github.io/digest/
129+
repository: https://CRAN.R-project.org/package=digest
130130
authors:
131-
- family-names: Ooms
132-
given-names: Jeroen
133-
email: jeroenooms@gmail.com
134-
orcid: https://orcid.org/0000-0002-4035-0289
135-
year: '2025'
136-
doi: 10.32614/CRAN.package.jsonlite
131+
- family-names: Eddelbuettel
132+
given-names: Dirk
133+
email: edd@debian.org
134+
orcid: https://orcid.org/0000-0001-6419-907X
135+
year: '2026'
136+
doi: 10.32614/CRAN.package.digest
137+
- type: software
138+
title: memoise
139+
abstract: 'memoise: ''Memoisation'' of Functions'
140+
notes: Imports
141+
url: https://memoise.r-lib.org
142+
repository: https://CRAN.R-project.org/package=memoise
143+
authors:
144+
- family-names: Wickham
145+
given-names: Hadley
146+
email: hadley@rstudio.com
147+
- family-names: Hester
148+
given-names: Jim
149+
- family-names: Chang
150+
given-names: Winston
151+
email: winston@rstudio.com
152+
- family-names: Müller
153+
given-names: Kirill
154+
email: krlmlr+r@mailbox.org
155+
- family-names: Cook
156+
given-names: Daniel
157+
email: danielecook@gmail.com
158+
year: '2026'
159+
doi: 10.32614/CRAN.package.memoise
160+
- type: software
161+
title: RcppSimdJson
162+
abstract: 'RcppSimdJson: ''Rcpp'' Bindings for the ''simdjson'' Header-Only Library
163+
for ''JSON'' Parsing'
164+
notes: Imports
165+
url: https://github.com/eddelbuettel/rcppsimdjson/
166+
repository: https://CRAN.R-project.org/package=RcppSimdJson
167+
authors:
168+
- family-names: Eddelbuettel
169+
given-names: Dirk
170+
email: edd@debian.org
171+
orcid: https://orcid.org/0000-0001-6419-907X
172+
- family-names: Knapp
173+
given-names: Brendan
174+
orcid: https://orcid.org/0000-0003-3284-4972
175+
- family-names: Lemire
176+
given-names: Daniel
177+
orcid: https://orcid.org/0000-0003-3306-6922
178+
year: '2026'
179+
doi: 10.32614/CRAN.package.RcppSimdJson
137180
- type: software
138181
title: rlang
139182
abstract: 'rlang: Functions for Base Types and Core R and ''Tidyverse'' Features'
@@ -147,7 +190,7 @@ references:
147190
- family-names: Wickham
148191
given-names: Hadley
149192
email: hadley@posit.co
150-
year: '2025'
193+
year: '2026'
151194
doi: 10.32614/CRAN.package.rlang
152195
- type: software
153196
title: utils
@@ -158,7 +201,60 @@ references:
158201
institution:
159202
name: R Foundation for Statistical Computing
160203
address: Vienna, Austria
161-
year: '2025'
204+
year: '2026'
205+
- type: software
206+
title: withr
207+
abstract: 'withr: Run Code ''With'' Temporarily Modified Global State'
208+
notes: Imports
209+
url: https://withr.r-lib.org
210+
repository: https://CRAN.R-project.org/package=withr
211+
authors:
212+
- family-names: Hester
213+
given-names: Jim
214+
- family-names: Henry
215+
given-names: Lionel
216+
email: lionel@posit.co
217+
- family-names: Müller
218+
given-names: Kirill
219+
email: krlmlr+r@mailbox.org
220+
- family-names: Ushey
221+
given-names: Kevin
222+
email: kevinushey@gmail.com
223+
- family-names: Wickham
224+
given-names: Hadley
225+
email: hadley@posit.co
226+
- family-names: Chang
227+
given-names: Winston
228+
year: '2026'
229+
doi: 10.32614/CRAN.package.withr
230+
- type: software
231+
title: yaml
232+
abstract: 'yaml: Methods to Convert R Data to YAML and Back'
233+
notes: Imports
234+
url: https://yaml.r-lib.org
235+
repository: https://CRAN.R-project.org/package=yaml
236+
authors:
237+
- family-names: Stephens
238+
given-names: Jeremy
239+
- family-names: Simonov
240+
given-names: Kirill
241+
year: '2026'
242+
doi: 10.32614/CRAN.package.yaml
243+
- type: software
244+
title: callr
245+
abstract: 'callr: Call R from R'
246+
notes: Suggests
247+
url: https://callr.r-lib.org
248+
repository: https://CRAN.R-project.org/package=callr
249+
authors:
250+
- family-names: Csárdi
251+
given-names: Gábor
252+
email: csardi.gabor@gmail.com
253+
orcid: https://orcid.org/0000-0001-7098-9676
254+
- family-names: Chang
255+
given-names: Winston
256+
year: '2026'
257+
doi: 10.32614/CRAN.package.callr
162258
- type: software
163259
title: quarto
164260
abstract: 'quarto: R Interface to ''Quarto'' Markdown Publishing System'
@@ -174,7 +270,7 @@ references:
174270
given-names: Christophe
175271
email: cderv@posit.co
176272
orcid: https://orcid.org/0000-0003-4474-2498
177-
year: '2025'
273+
year: '2026'
178274
doi: 10.32614/CRAN.package.quarto
179275
- type: software
180276
title: rJava
@@ -186,7 +282,7 @@ references:
186282
- family-names: Urbanek
187283
given-names: Simon
188284
email: simon.urbanek@r-project.org
189-
year: '2025'
285+
year: '2026'
190286
doi: 10.32614/CRAN.package.rJava
191287
- type: software
192288
title: testthat
@@ -198,32 +294,7 @@ references:
198294
- family-names: Wickham
199295
given-names: Hadley
200296
email: hadley@posit.co
201-
year: '2025'
297+
year: '2026'
202298
doi: 10.32614/CRAN.package.testthat
203299
version: '>= 3.0.0'
204-
- type: software
205-
title: withr
206-
abstract: 'withr: Run Code ''With'' Temporarily Modified Global State'
207-
notes: Suggests
208-
url: https://withr.r-lib.org
209-
repository: https://CRAN.R-project.org/package=withr
210-
authors:
211-
- family-names: Hester
212-
given-names: Jim
213-
- family-names: Henry
214-
given-names: Lionel
215-
email: lionel@posit.co
216-
- family-names: Müller
217-
given-names: Kirill
218-
email: krlmlr+r@mailbox.org
219-
- family-names: Ushey
220-
given-names: Kevin
221-
email: kevinushey@gmail.com
222-
- family-names: Wickham
223-
given-names: Hadley
224-
email: hadley@posit.co
225-
- family-names: Chang
226-
given-names: Winston
227-
year: '2025'
228-
doi: 10.32614/CRAN.package.withr
229300

R/global_params.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ global_quiet_param <- function(quiet) {
1515
#' Documentation template for rJava path-locking behavior.
1616
#'
1717
#' @section rJava Path-Locking:
18-
#' **Important for \strong{rJava} Users**: This function sets environment variables
19-
#' (JAVA_HOME, PATH) that affect both command-line Java tools and \strong{rJava} initialization.
20-
#' However, due to \strong{rJava}'s path-locking behavior when \code{\link[rJava]{.jinit}} is called
18+
#' **Important for rJava Users**: This function sets environment variables
19+
#' (JAVA_HOME, PATH) that affect both command-line Java tools and rJava initialization.
20+
#' However, due to rJava's path-locking behavior when \code{\link[rJava]{.jinit}} is called
2121
#' (see \url{https://github.com/s-u/rJava/issues/25}, \url{https://github.com/s-u/rJava/issues/249}, and \url{https://github.com/s-u/rJava/issues/334}),
2222
#' this function must be called **BEFORE** \code{\link[rJava]{.jinit}} is invoked. Once \code{\link[rJava]{.jinit}}
2323
#' initializes, the Java version is locked for that R session and cannot be changed without restarting R.
2424
#'
2525
#' \code{\link[rJava]{.jinit}} is invoked (and Java locked) when you:
2626
#' \itemize{
2727
#' \item Explicitly call \code{library(rJava)}
28-
#' \item Load any package that imports \strong{rJava} (which auto-loads it as a dependency)
28+
#' \item Load any package that imports rJava (which auto-loads it as a dependency)
2929
#' \item Even just use IDE autocomplete with \code{rJava::} (this triggers initialization!)
30-
#' \item Call any \strong{rJava}-dependent function
30+
#' \item Call any rJava-dependent function
3131
#' }
3232
#'
33-
#' Once any of these happen, the Java version used by \strong{rJava} for that session is locked in.
34-
#' For command-line Java tools that don't use \strong{rJava}, this function can be called at any
33+
#' Once any of these happen, the Java version used by rJava for that session is locked in.
34+
#' For command-line Java tools that don't use rJava, this function can be called at any
3535
#' time to switch Java versions for subsequent system calls.
3636
#'
3737
#' @keywords internal

R/java_download.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ java_download <- function(
3737
force = FALSE,
3838
temp_dir = FALSE
3939
) {
40+
# Override cache_path if temp_dir is set to TRUE
4041
# Override cache_path if temp_dir is set to TRUE
4142
if (temp_dir) {
42-
temp_dir <- tempdir()
43-
setwd(temp_dir)
44-
if (!dir.exists("rJavaEnv_cache")) {
45-
dir.create("rJavaEnv_cache", recursive = TRUE)
43+
cache_path <- file.path(tempdir(), "rJavaEnv_cache")
44+
if (!dir.exists(cache_path)) {
45+
dir.create(cache_path, recursive = TRUE)
4646
}
47-
cache_path <- file.path(temp_dir, "rJavaEnv_cache")
4847
}
4948

5049
# Validate version

R/java_list_available.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#'
2626
#' @export
2727
#' @examples
28-
#' \donttest{
28+
#' \dontrun{
2929
#' # List all available versions for current platform
3030
#' java_list_available()
3131
#'

R/java_manage_project.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
#' @export
88
#'
99
#' @examples
10-
#' java_list_project(project_path)
11-
10+
#' \donttest{
11+
#' java_list_project()
12+
#' }
1213
java_list_project <- function(
1314
project_path = NULL,
1415
output = c("data.frame", "vector"),

R/java_quick_install.R

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@ java_quick_install <- function(
2626
rje_consent_check()
2727

2828
if (temp_dir) {
29-
temp_dir <- tempdir()
30-
setwd(temp_dir)
31-
if (!dir.exists("rJavaEnv_cache")) {
32-
dir.create("rJavaEnv_cache", recursive = TRUE)
29+
# Use session temp directory
30+
temp_path <- tempdir()
31+
32+
cache_path <- file.path(temp_path, "rJavaEnv_cache")
33+
if (!dir.exists(cache_path)) {
34+
dir.create(cache_path, recursive = TRUE)
3335
}
34-
cache_path <- file.path(temp_dir, "rJavaEnv_cache")
35-
if (!dir.exists("rJavaEnv_project")) {
36-
dir.create("rJavaEnv_project", recursive = TRUE)
36+
37+
project_path <- file.path(temp_path, "rJavaEnv_project")
38+
if (!dir.exists(project_path)) {
39+
dir.create(project_path, recursive = TRUE)
3740
}
38-
project_path <- file.path(temp_dir, "rJavaEnv_project")
3941
} else {
4042
cache_path <- getOption("rJavaEnv.cache_path")
4143
}

R/java_scoped.R

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@
2222
#' @return Invisibly returns the path to the selected JAVA_HOME.
2323
#' @export
2424
#' @examples
25-
#' \donttest{
25+
#' \dontrun{
2626
#' # Using system2
2727
#' my_tool_wrapper <- function() {
2828
#' rJavaEnv::local_java_env(version = 21)
2929
#' system2("java", "-version")
3030
#' } # Environment restored automatically here
3131
#'
3232
#' # Using processx
33-
#' run_java_jar <- function(jar_path, args) {
34-
#' rJavaEnv::local_java_env(version = 21)
35-
#' processx::run("java", c("-jar", jar_path, args))
36-
#' }
33+
#' # run_java_jar <- function(jar_path, args) {
34+
#' # rJavaEnv::local_java_env(version = 21)
35+
#' # processx::run("java", c("-jar", jar_path, args))
36+
#' # }
3737
#'
3838
#' # With caching for repeated calls
39-
#' process_files <- function(files) {
40-
#' for (f in files) {
41-
#' rJavaEnv::local_java_env(version = 21, .use_cache = TRUE)
42-
#' processx::run("java", c("-jar", "processor.jar", f))
43-
#' }
44-
#' }
39+
#' # process_files <- function(files) {
40+
#' # for (f in files) {
41+
#' # rJavaEnv::local_java_env(version = 21, .use_cache = TRUE)
42+
#' # processx::run("java", c("-jar", "processor.jar", f))
43+
#' # }
44+
#' # }
4545
#' }
4646
local_java_env <- function(
4747
version,
@@ -114,9 +114,9 @@ local_java_env <- function(
114114
#' })
115115
#'
116116
#' # Using processx
117-
#' rJavaEnv::with_java_env(version = 21, {
118-
#' processx::run("java", c("-jar", "tool.jar", "--help"))
119-
#' })
117+
#' # rJavaEnv::with_java_env(version = 21, {
118+
#' # processx::run("java", c("-jar", "tool.jar", "--help"))
119+
#' # })
120120
#' }
121121
with_java_env <- function(version, code, ...) {
122122
local_java_env(version = version, ...)

R/java_unpack.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' @return A `character` vector containing of length 1 containing the path to the unpacked Java directory.
1313
#' @export
1414
#' @examples
15-
#' \donttest{
15+
#' \dontrun{
1616
#'
1717
#' # set cache dir to temporary directory
1818
#' options(rJavaEnv.cache_path = tempdir())

0 commit comments

Comments
 (0)