From a1ab4dd6a7cd20a993b784a1266d59c98e5f6cd8 Mon Sep 17 00:00:00 2001 From: "Daniel E. de la Rosa" Date: Thu, 4 Jan 2024 15:51:14 -0400 Subject: [PATCH] fix: export unpkg-right-assign --- DESCRIPTION | 2 +- NAMESPACE | 1 + R/unpack_assign.R | 18 +++++++++++++++--- man/unpkg-right-assign.Rd | 24 ++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 man/unpkg-right-assign.Rd diff --git a/DESCRIPTION b/DESCRIPTION index ea3cbfa..3351634 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: Dmisc Title: Daniel miscellaneous functions -Version: 0.3.7 +Version: 0.3.8 Authors@R: person(given = "Daniel E.", family = "de la Rosa", diff --git a/NAMESPACE b/NAMESPACE index 2460717..a72c511 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,5 +1,6 @@ # Generated by roxygen2: do not edit by hand +export("%...>%") export("%<...%") export("%>%") export("%T>%") diff --git a/R/unpack_assign.R b/R/unpack_assign.R index 7a7dc0b..b562546 100644 --- a/R/unpack_assign.R +++ b/R/unpack_assign.R @@ -74,9 +74,21 @@ -# @rdname unpkg-assign -# @order 2 -# @export + +#' Assign values to specified names in an environment and unpack the values (reverse of `%<...%`) +#' +#' @param values A list or vector containing the values to be assigned to the names. +#' @param names A list or character vector specifying the names of variables to be assigned. +#' +#' @return NULL. The function performs assignments in the specified environment. +#' @export +#' +#' @rdname unpkg-right-assign +#' +#' @examples +#' \dontrun{ +#' list(1, 2) %...>% c("x", "y") +#' } `%...>%` <- function(values, names) { `%<...%`(names, values) } diff --git a/man/unpkg-right-assign.Rd b/man/unpkg-right-assign.Rd new file mode 100644 index 0000000..540a858 --- /dev/null +++ b/man/unpkg-right-assign.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/unpack_assign.R +\name{\%...>\%} +\alias{\%...>\%} +\title{Assign values to specified names in an environment and unpack the values (reverse of \verb{\%<...\%})} +\usage{ +values \%...>\% names +} +\arguments{ +\item{values}{A list or vector containing the values to be assigned to the names.} + +\item{names}{A list or character vector specifying the names of variables to be assigned.} +} +\value{ +NULL. The function performs assignments in the specified environment. +} +\description{ +Assign values to specified names in an environment and unpack the values (reverse of \verb{\%<...\%}) +} +\examples{ +\dontrun{ +list(1, 2) \%...>\% c("x", "y") +} +}