Closed pat-s closed 5 years ago
The complete list of dependencies:
setdiff(package_dependencies("purrr", recursive=TRUE)[[1L]], getOption("defaultPackages"))
[1] "magrittr" "rlang" "tibble" "cli" "crayon"
[6] "pillar" "assertthat" "fansi" "utf8" "tools"
Here is a simple replacement for imap
(without the NSE for obvious reasons):
imap = function(.x, .f) {
Map(.f, .x = .x, .y = seq_along(.x))
}
For map_xxx
we have the v[ilnc]apply
alternatives in BBmisc.
I'm not saying that I generally don't like the purrr package, but I believe we should either use it everywhere or stick to the previously used apply functions.
Here is a simple replacement for imap (without the NSE for obvious reasons):
cool.
For map_xxx we have the v[ilnc]apply alternatives in BBmisc.
I'm not saying that I generally don't like the purrr package, but I believe we should either use it everywhere or stick to the previously used apply functions.
Yes. Let's see if I can get rid of them then.
The complete list of dependencies:
Meta questions:
Meta questions:
- Would you consider this amount as "many"?
- The question is anyhow if these deps are so "heavy" bc a normal R user nowadays has all of these deps installed via other pkgs anyway?
I guess it is a tradeoff. You don't want to reinvent the wheel, but http://www.tinyverse.org/ also got some arguments.
For some wrappers around lapply
, purrr looks quite heavy.
- should we rely on purrr in mlr3?
Are you suggesting to import purrr and replace all calls to lapply/vapply/mapply/... with their purrr counterparts? :wink:
http://www.tinyverse.org/ also got some arguments.
Nice reference.
Are you suggesting to import purrr and replace all calls to lapply/vapply/mapply/... with their purrr counterparts? wink
I guess I do not need an answer for this anymore ;)
The point I had is that using pkgs that are widely known to the com make it way easier for people to contribute bc you do not have to tell them "have a look at our 999+ helper functions in pkg X that we wrote because base-R sucks and dependencies even more".
Bernd raised the question on Slack. https://cran.r-project.org/web/packages/purrr/index.html purrr deps:
imap()
function in some code parts which is not available elsewhere.