Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save Praat form arguments as attributes in returned object #2

Open
stefanocoretta opened this issue Jan 20, 2021 · 0 comments
Open

Comments

@stefanocoretta
Copy link
Owner

stefanocoretta commented Jan 20, 2021

When running praat_run() with arguments to be passed to form in the Praat script, the returned object should have an attribute args with a named list of arguments and their value.

For example:

obj <- run_praat("script.praat", "Hertz", 0.5, capture = TRUE)
attributes(obj)
> $args
> $args$unit
> [1] "Hertz"
>
> $args$window
> [1] 0.5

How to assign names? Perhaps:

obj <- run_praat("script.praat", "Hertz", 0.5, capture = TRUE, args = c("unit", "window"))

or better, use named args.

test <- function(...) names(list(...))
test(1, a = "a", b = "b")
> [1] ""  "a" "b"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant