Skip to content

Commit

Permalink
Merge pull request #18 from nanxstats/zzz
Browse files Browse the repository at this point in the history
Move `.onLoad()` to `zzz.R` following convention
  • Loading branch information
nanxstats authored Sep 2, 2024
2 parents 5a5171d + b760c7c commit 57ab337
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
14 changes: 0 additions & 14 deletions R/package.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
#' @keywords internal
"_PACKAGE"

#' Global reference to ssw-py
#'
#' Global reference to ssw-py which will be initialized in `.onLoad`.
#'
#' @return ssw-py reference object
#'
#' @export ssw_py
ssw_py <- NULL

.onLoad <- function(libname, pkgname) {
reticulate::use_virtualenv("r-ssw-py", required = FALSE)
ssw_py <<- reticulate::import("ssw", delay_load = TRUE)
}
13 changes: 13 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#' Global reference to ssw-py
#'
#' Global reference to ssw-py which will be initialized in `.onLoad`.
#'
#' @return ssw-py reference object
#'
#' @export ssw_py
ssw_py <- NULL

.onLoad <- function(libname, pkgname) {
reticulate::use_virtualenv("r-ssw-py", required = FALSE)
ssw_py <<- reticulate::import("ssw", delay_load = TRUE)
}
2 changes: 1 addition & 1 deletion man/ssw_py.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 57ab337

Please sign in to comment.