From 0359300cd062dca707117fe7f12d98194569289d Mon Sep 17 00:00:00 2001 From: nperez Date: Thu, 31 Oct 2019 10:47:07 +0100 Subject: [PATCH 1/6] attribute dimnames reordered --- R/zzz.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/zzz.R b/R/zzz.R index 662624d..5358507 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -13,6 +13,9 @@ x <- x[as.vector(y)] } dim(x) <- old_dims[new_order] + if (names(attr_bk) == 'dimnames') { + attr_bk <- list(dimnames = attr_bk$dimnames[new_order]) + } attributes(x) <- c(attributes(x), attr_bk) x } -- GitLab From 58fbae696573b645cd16c9176aafe6c3976bc21e Mon Sep 17 00:00:00 2001 From: nperez Date: Thu, 31 Oct 2019 14:23:03 +0100 Subject: [PATCH 2/6] attributes can be length zero --- R/zzz.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/zzz.R b/R/zzz.R index 5358507..8f27f87 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -13,8 +13,10 @@ x <- x[as.vector(y)] } dim(x) <- old_dims[new_order] - if (names(attr_bk) == 'dimnames') { - attr_bk <- list(dimnames = attr_bk$dimnames[new_order]) + if (length(attr_bk) > 0) { + if (names(attr_bk) == 'dimnames') { + attr_bk <- list(dimnames = attr_bk$dimnames[new_order]) + } } attributes(x) <- c(attributes(x), attr_bk) x -- GitLab From 2421a22bdf49a388dbc6b55b808ca5837eb2a162 Mon Sep 17 00:00:00 2001 From: nperez Date: Fri, 3 Apr 2020 11:06:29 +0200 Subject: [PATCH 3/6] parent directory the function environment --- R/Apply.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Apply.R b/R/Apply.R index bbd71ae..108811d 100644 --- a/R/Apply.R +++ b/R/Apply.R @@ -507,7 +507,7 @@ Apply <- function(data, target_dims = NULL, fun, ..., chunk_sizes <- c(chunk_sizes, total_size %% chunk_size) } - fun_env <- new.env(parent = parent.frame()) + fun_env <- new.env(parent = environment(fun)) for (i in seq_along(extra_info)) { assign(names(extra_info)[i], extra_info[[i]], envir = fun_env) } -- GitLab From 04d43cc270b75e259512169eadf81ff057b7a7d6 Mon Sep 17 00:00:00 2001 From: nperez Date: Thu, 21 Jan 2021 18:08:27 +0100 Subject: [PATCH 4/6] Bumped version number and license changed --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4f7c94f..68eacfa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: multiApply Title: Apply Functions to Multiple Multidimensional Arrays or Vectors -Version: 2.1.1 +Version: 2.1.2 Authors@R: c( person("BSC-CNS", role = c("aut", "cph")), person("Nicolau", "Manubens", , "nicolau.manubens@bsc.es", role = "aut"), @@ -29,7 +29,7 @@ Imports: plyr Suggests: testthat -License: LGPL-3 +License: Apache License 2.0 URL: https://earth.bsc.es/gitlab/ces/multiApply BugReports: https://earth.bsc.es/gitlab/ces/multiApply/issues Encoding: UTF-8 -- GitLab From 62c42e469fd733051fbd585566674b7e88a412c5 Mon Sep 17 00:00:00 2001 From: nperez Date: Thu, 21 Jan 2021 18:39:52 +0100 Subject: [PATCH 5/6] Fix url has been changed --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 68eacfa..f39632b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -31,7 +31,7 @@ Suggests: testthat License: Apache License 2.0 URL: https://earth.bsc.es/gitlab/ces/multiApply -BugReports: https://earth.bsc.es/gitlab/ces/multiApply/issues +BugReports: https://earth.bsc.es/gitlab/ces/multiApply/-/issues Encoding: UTF-8 LazyData: true RoxygenNote: 5.0.0 -- GitLab From 39737bf1e7a82025462681bb79a6c6feccccb71d Mon Sep 17 00:00:00 2001 From: nperez Date: Thu, 21 Jan 2021 19:03:47 +0100 Subject: [PATCH 6/6] undo the changes for dimnames --- R/zzz.R | 5 ----- 1 file changed, 5 deletions(-) diff --git a/R/zzz.R b/R/zzz.R index 8f27f87..662624d 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -13,11 +13,6 @@ x <- x[as.vector(y)] } dim(x) <- old_dims[new_order] - if (length(attr_bk) > 0) { - if (names(attr_bk) == 'dimnames') { - attr_bk <- list(dimnames = attr_bk$dimnames[new_order]) - } - } attributes(x) <- c(attributes(x), attr_bk) x } -- GitLab