recycling_help | R Documentation |
Check for and conduct recycling in the environment that calls functions from this family.
Arguments are recyclable if all of their lengths are divisors of the argument with the greatest length subject to any settings in the optional arguments .n
, .min
, .max
, and/or .targ
.
recycling_help()
recyclable_ns(..., .n = NULL, .min = NULL, .max = NULL, .targ = NULL)
recyclable(..., .n = NULL, .min = 1, .max = NULL, .targ = NULL, .err = FALSE)
recycle(..., .n = NULL, .min = 1, .max = NULL, .targ = NULL)
... |
For |
.n |
Either |
.min |
Either |
.max |
Either |
.targ |
Either |
.err |
|
A logical scalar
recyclableN, recyclable
The NULL
object
recycle
recyclable_ns()
: Checks whether numeric scalar arguments in ...
indicate recyclable lengths, subject to restrictions in .n
, .min
, .max
, and .targ
.
recyclable()
: Checks whether arguments in ...
are recyclable, subject to restrictions in .n
, .min
, .max
, and .targ
.
recycle()
: Recycles named arguments in ...
in the environment of the calling function, subject to restrictions in .n
, .min
, .max
, and .targ
.
Other environments:
callers()
,
os()
,
value_exists()
Other meta:
callers()
,
console_help()
,
dot_args()
,
pause()
,
ply_help()
,
purge_help()
,
run()
egN1. <- 1
egN2 <- 1:2
egN3 <- 1:3
egN4 <- 1:4
egC1 <- paste0("'", letters[egN1], "'")
egC2 <- paste0("'", letters[egN2], "'")
egC3 <- paste0("'", letters[egN3], "'")
egC4 <- paste0("'", letters[egN4], "'")
egRecycle <- function(A, B, C) {
asc <- function(n, v) {paste0(n, " = c(", paste0(v, collapse = ", "), ")")}
recycle(A = A, B = B, C = C)
cat(paste0(asc("A", A), "\n", asc("B", B), "\n", asc("C", C)))
}
egRecycle(egN4, egC2, egN1)
egRecycle(egC1, egN2, egC4)
egRecycle(egN3, egC3, egC1)
egRecycle(egN3, egC3, egN3)
recyclableN(1:3)
recyclableN(2, 4, 8)
recyclableN(2, 4, 8, .n = c(2, 4, 8, 16))
recyclableN(2, 4, 8, .min = 4)
recyclableN(2, 4, 8, .max = 4)
recyclableN(2, 4, 8, .targ = 7)
recyclableN(2, 4, 8, .targ = 8)
recyclableN(2, 4, 8, .targ = 16)
recyclable(egN1, egC2, egN3)
recyclable(egN4, egC2, egN1)
recyclable(egC1, egN2, egC4)
recyclable(egN3, egC3, egC1)
recyclable(egN3, egC3, egN3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.