Displaying 3 results from an estimated 3 matches for "small_helper".
Did you mean:
call_helper
2023 Mar 11
1
Multiple Assignment built into the R Interpreter?
...not equal to
length(rhs)")
list2env(`names<-`(rhs, lhs), envir = parent.frame())
invisible()
}
but as you say, the input needs to be converted to a list, and it calls
several R functions, which led me to end up writing `%=%` in C:
https://github.com/SebKrantz/collapse/blob/master/src/small_helper.c#L162.
This implementation works in the way you describe, i.e. it has separate
methods for all the standard vector types, and coerces to list otherwise.
That being said, all implementations in packages falls short of being very
useful, because R CMD Check it will still require global bindings for...
2023 Mar 11
1
Multiple Assignment built into the R Interpreter?
...?? list2env(`names<-`(rhs, lhs), envir = parent.frame())
> ?? invisible()
> }
>
> but as you say, the input needs to be converted to a list, and it calls
> several R functions, which led me to end up writing `%=%` in C:
> https://github.com/SebKrantz/collapse/blob/master/src/small_helper.c#L162 <https://github.com/SebKrantz/collapse/blob/master/src/small_helper.c#L162>.
> This implementation works in the way you describe, i.e. it has separate
> methods for all the standard vector types, and coerces to list otherwise.
>
> That being said, all implementations in p...
2023 Mar 11
1
Multiple Assignment built into the R Interpreter?
I think the standard way to do this in R is given by list2env(), as
described in a couple of answers on the SO page you linked.
The syntax you proposed would be likely to be confusing in complex
expressions, e.g.
f(A, C, Q, R = init_matrices(X, Y, Z))
would obviously not work but wouldn't trigger a syntax error, and
f((A, C, Q, R = init_matrices(X, Y, Z)))
could work, but looks