From 63c368037eb3f8223d23fd31db9ac8f5e2169082 Mon Sep 17 00:00:00 2001 From: James J Balamuta Date: Thu, 11 Jan 2024 16:23:24 -0800 Subject: [PATCH] Export function and switch name to `in_webr()` --- NAMESPACE | 1 + R/is-wasm.R | 5 +++-- man/demorwasmbinary-package.Rd | 24 ++++++++++++++++++++++++ man/{is_r_using_wasm.Rd => in_webr.Rd} | 8 ++++---- 4 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 man/demorwasmbinary-package.Rd rename man/{is_r_using_wasm.Rd => in_webr.Rd} (82%) diff --git a/NAMESPACE b/NAMESPACE index 6ae9268..313aea6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,2 +1,3 @@ # Generated by roxygen2: do not edit by hand +export(in_webr) diff --git a/R/is-wasm.R b/R/is-wasm.R index 80e48e7..b4e5e72 100644 --- a/R/is-wasm.R +++ b/R/is-wasm.R @@ -4,7 +4,8 @@ #' that matches `"wasm32"`. If its the case, we're likely using webR to access #' R. #' +#' @export #' @examples #' # Check to see if WASM is active -#' is_r_using_wasm() -is_r_using_wasm <- function() { R.Version()$arch == "wasm32"} +#' in_webr() +in_webr <- function() { R.Version()$os == "emscripten" } diff --git a/man/demorwasmbinary-package.Rd b/man/demorwasmbinary-package.Rd new file mode 100644 index 0000000..75f3ddd --- /dev/null +++ b/man/demorwasmbinary-package.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/demorwasmbinary-package.R +\docType{package} +\name{demorwasmbinary-package} +\alias{demorwasmbinary} +\alias{demorwasmbinary-package} +\title{demorwasmbinary: webR Demo for Generating WASM R Package Binaries} +\description{ +Package to test out generating Web Assembly binaries for R packages using r-wasm GitHub Actions. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/coatless-tutorials/webr-github-action-wasm-binaries} + \item \url{https://tutorials.thecoatlessprofessor.com/webr-github-action-wasm-binaries/} + \item Report bugs at \url{https://github.com/coatless-tutorials/webr-github-action-wasm-binaries/issues} +} + +} +\author{ +\strong{Maintainer}: James Balamuta \email{balamut2@illinois.edu} (\href{https://orcid.org/0000-0003-2826-8458}{ORCID}) + +} +\keyword{internal} diff --git a/man/is_r_using_wasm.Rd b/man/in_webr.Rd similarity index 82% rename from man/is_r_using_wasm.Rd rename to man/in_webr.Rd index c4b8202..d6e669b 100644 --- a/man/is_r_using_wasm.Rd +++ b/man/in_webr.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/is-wasm.R -\name{is_r_using_wasm} -\alias{is_r_using_wasm} +\name{in_webr} +\alias{in_webr} \title{Detect if version of R is built using Web Assembly (WASM)} \usage{ -is_r_using_wasm() +in_webr() } \description{ The function checks whether the compiled version of \emph{R} shows an architecture @@ -13,5 +13,5 @@ R. } \examples{ # Check to see if WASM is active -is_r_using_wasm() +in_webr() }