Skip to content

Commit

Permalink
use do.call(rbind, dots) in turtleSet()
Browse files Browse the repository at this point in the history
reverts the change in `turtleSet()` to use `rbind` instead of `rbind.agentMatrix` (with #50).

also note that the `do.call` construction doesn't need the `lapply(dots, function(x) x)` because `dots` is already a list, so extracting the elements only to put them back in a list seems redundant.
  • Loading branch information
achubaty committed Apr 26, 2024
1 parent e88d765 commit 0b15e63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ URL:
https://netlogor.predictiveecology.org,
https://github.com/PredictiveEcology/NetLogoR/,
https://groups.google.com/g/netlogor
Version: 1.0.5.9000
Date: 2024-04-25
Version: 1.0.5.9001
Date: 2024-04-26
Authors@R: c(
person("Sarah", "Bauduin", email = "sarahbauduin@hotmail.fr",
role = c("aut"), comment = c(ORCID = "0000-0002-3252-5894")),
Expand Down
2 changes: 1 addition & 1 deletion R/turtle-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -2679,7 +2679,7 @@ setMethod(
}

# if (do.call(all.equal, lapply(dots, colnames))) {
allTurtles <- do.call(rbind.agentMatrix, lapply(dots, function(x) x))
allTurtles <- do.call(rbind, dots)
# } else {
# allTurtles <- as.data.frame(rbindlist(lapply(dots, function(x) {
# inspect(x, who = of(agents = x, var = "who"))}), fill = TRUE))
Expand Down

0 comments on commit 0b15e63

Please sign in to comment.