From a6fab4053938e7a098eb698457e5b7bd61f6c762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liming=20Li=20=EF=BC=88=E6=9D=8E=E9=BB=8E=E6=98=8E?= =?UTF-8?q?=EF=BC=89?= Date: Mon, 29 Apr 2024 03:12:17 +0000 Subject: [PATCH] allow more control on the sas configuration --- DESCRIPTION | 2 +- NEWS.md | 3 +++ R/utils.R | 8 +++++--- man/sas_session.Rd | 7 +++++-- man/sas_session_ssh.Rd | 3 --- man/sasr-package.Rd | 3 ++- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 93bcce2..b933d9b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -41,4 +41,4 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 diff --git a/NEWS.md b/NEWS.md index c8abde8..c506204 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # sasr 0.1.2.9006 +* Update `sas_session` to allow finer control over the sas session. +* The argument `sascfg` has been replaced by `cfgfile` in `sas_session`. + # sasr 0.1.2 * First CRAN version of the package. diff --git a/R/utils.R b/R/utils.R index ba3c26e..f53f5b7 100644 --- a/R/utils.R +++ b/R/utils.R @@ -120,13 +120,15 @@ get_sas_session <- function() { #' @description `r lifecycle::badge("experimental")` #' Create a SAS session. #' -#' @param sascfg (`character`)\cr SAS session configuration. +#' @param cfgfile (`string`)\cr SAS session configuration. +#' @param ... additional arguments passed to `saspy.SASsession()`. +#' Can override the configuration file. #' #' @return SAS session. #' @export -sas_session <- function(sascfg = get_sas_cfg()) { +sas_session <- function(cfgfile = get_sas_cfg(), ...) { validate_sascfg(sascfg) - session <- saspy$SASsession(cfgfile = sascfg) + session <- saspy$SASsession(cfgfile = sascfg, ...) .sasr_env$.sas_session <- session return(session) } diff --git a/man/sas_session.Rd b/man/sas_session.Rd index 62540e9..37d441e 100644 --- a/man/sas_session.Rd +++ b/man/sas_session.Rd @@ -4,10 +4,13 @@ \alias{sas_session} \title{Create SAS Session Based on Configuration File} \usage{ -sas_session(sascfg = get_sas_cfg()) +sas_session(cfgfile = get_sas_cfg(), ...) } \arguments{ -\item{sascfg}{(\code{character})\cr SAS session configuration.} +\item{cfgfile}{(\code{string})\cr SAS session configuration.} + +\item{...}{additional arguments passed to \code{saspy.SASsession()}. +Can override the configuration file.} } \value{ SAS session. diff --git a/man/sas_session_ssh.Rd b/man/sas_session_ssh.Rd index 54efcb8..db19631 100644 --- a/man/sas_session_ssh.Rd +++ b/man/sas_session_ssh.Rd @@ -6,9 +6,6 @@ \usage{ sas_session_ssh(sascfg = get_sas_cfg()) } -\arguments{ -\item{sascfg}{(\code{character})\cr SAS session configuration.} -} \value{ SAS session. } diff --git a/man/sasr-package.Rd b/man/sasr-package.Rd index 2353494..073c988 100644 --- a/man/sasr-package.Rd +++ b/man/sasr-package.Rd @@ -2,8 +2,8 @@ % Please edit documentation in R/sasr-package.R \docType{package} \name{sasr-package} +\alias{sasr} \alias{sasr-package} -\alias{_PACKAGE} \title{\code{sasr} Package} \description{ \code{sasr} provides interface to SAS through \code{saspy} and \code{reticulate} in R. @@ -12,6 +12,7 @@ Useful links: \itemize{ \item \url{https://github.com/insightsengineering/sasr/} + \item \url{https://insightsengineering.github.io/sasr/latest-tag/} \item Report bugs at \url{https://github.com/insightsengineering/sasr/issues} }