Package 'magicfor'

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

Help Index


Check whether for() is magicalized or not

Description

Check whether for() is magicalized or not

Usage

is_magicalized(envir = parent.frame())

Arguments

envir

environment

Value

TRUE if for() is magicalized.


Magicalize for()

Description

Magicalize for()

Usage

magic_for(func = put, progress = FALSE, test = FALSE, silent = FALSE,
  temporary = FALSE, max_object_size = 1 * MB)

Arguments

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

Description

Free magicalizetion and clear the result

Usage

magic_free()

Get values stored by magicalized for loops as a list

Description

Get values stored by magicalized for loops as a list

Usage

magic_result()

Value

list


Get values stored by magicalized for loops as a data.frame

Description

Get values stored by magicalized for loops as a data.frame

Usage

magic_result_as_dataframe(iter = TRUE)

Arguments

iter

logical. Include iterator into the result.

Value

data.frame


Get values stored by magicalized for loops as a vector

Description

Get values stored by magicalized for loops as a vector

Usage

magic_result_as_vector()

Value

vector


Print values

Description

Print values

Usage

put(..., envir = parent.frame())

Arguments

...

values

envir

environment