Displaying 4 results from an estimated 4 matches for "sebkrantz".
2023 Mar 11
1
Multiple Assignment built into the R Interpreter?
...ength(rhs)) stop("length(lhs) 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...
2023 Mar 11
1
Multiple Assignment built into the R Interpreter?
...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 <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.
>
> Tha...
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
2019 Feb 26
5
Improved Data Aggregation and Summary Statistics in R
Dear Developers,
Having spent time developing and thinking about how data aggregation and
summary statistics can be enhanced in R, I would like to present my
ideas/efforts in the form of two commands:
The first, which for now I called 'collap', is an upgrade of aggregate that
accommodates and extends the functionality of aggregate in various
respects, most importantly to work with