Title: | Magic Functions to Obtain Results from for Loops |
---|---|
Description: | Magic functions to obtain results from for loops. |
Authors: | Koji Makiyama [cre, aut] |
Maintainer: | Koji Makiyama <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-19 05:40:50 UTC |
Source: | https://github.com/hoxo-m/magicfor |
Check whether for() is magicalized or not
is_magicalized(envir = parent.frame())
is_magicalized(envir = parent.frame())
envir |
environment |
TRUE if for() is magicalized.
Magicalize for()
magic_for(func = put, progress = FALSE, test = FALSE, silent = FALSE, temporary = FALSE, max_object_size = 1 * MB)
magic_for(func = put, progress = FALSE, test = FALSE, silent = FALSE, temporary = FALSE, max_object_size = 1 * MB)
func |
function name. The target function for magicalization. |
progress |
logical. If TRUE, show progress bar. |
test |
logical or a number. If TRUE or a number, limit iteration times to it. |
silent |
logical. If TRUE, do not execute func. Usually, func is print something. |
temporary |
logical. If TRUE, once run for(), free magicalization. |
max_object_size |
a number. Prevent to store large iterator. Default to 1 MB. |
Free magicalizetion and clear the result
magic_free()
magic_free()
Get values stored by magicalized for loops as a list
magic_result()
magic_result()
list
Get values stored by magicalized for loops as a data.frame
magic_result_as_dataframe(iter = TRUE)
magic_result_as_dataframe(iter = TRUE)
iter |
logical. Include iterator into the result. |
data.frame
Get values stored by magicalized for loops as a vector
magic_result_as_vector()
magic_result_as_vector()
vector
Print values
put(..., envir = parent.frame())
put(..., envir = parent.frame())
... |
values |
envir |
environment |