Skip to content

Commit

Permalink
fix on fixes for by data.table
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-navarro committed Apr 9, 2024
1 parent f3ca204 commit 0caa3e6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions R/maps.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ formula_map <- function() {
list(
"HDI2020" = list(
"associations" = "s2",
"activations" = "",
"pools" = "s2,type",
"activations" = c(),
"pools" = c("s2", "type"),
"responses" = "s2"
),
"HD2022" = list(
"associations" = "s2",
"activations" = "",
"pools" = "s2,type",
"activations" = c(),
"pools" = c("s2", "type"),
"responses" = "s2"
),
"RW1972" = list(
Expand All @@ -19,25 +19,25 @@ formula_map <- function() {
"MAC1975" = list(
"responses" = "s2",
"associations" = "s2",
"associabilities" = ""
"associabilities" = c()
),
"SM2007" = list(
"activations" = "s2",
"relative_activations" = "s2",
"associations" = "s2",
"operator_switches" = "s2,comparison"
"operator_switches" = c("s2", "comparison")
),
"PKH1982" = list(
"responses" = "s2",
"associabilities" = "",
"associations" = "s2,type"
"associabilities" = c(),
"associations" = c("s2", "type")
),
"ANCCR" = list(
"ij_eligibilities" = "",
"i_eligibilities" = "",
"i_base_rate" = "",
"ij_eligibilities" = c(),
"i_eligibilities" = c(),
"i_base_rate" = c(),
"ij_base_rate" = "s2",
"representation_contingencies" = "s2,type",
"representation_contingencies" = c("s2", "type"),
"net_contingencies" = "s2",
"anccrs" = "s2",
"causal_weights" = "s2",
Expand All @@ -46,7 +46,7 @@ formula_map <- function() {
"probabilities" = "s2"
),
"TD" = list(
"associations" = "s2,t_bin",
"associations" = c("s2", "t_bin"),
"eligibilities" = "t_bin",
"values" = "t_bin"
),
Expand Down
2 changes: 1 addition & 1 deletion R/model_graphs.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ calmr_model_graph <- function(
# aggregate data
x <- data.table::setDT(x)[trial == t,
list("value" = mean(value)),
by = c("s1","s2")
by = c("s1", "s2")
]
net <- ggnetwork::ggnetwork(network::as.network(x, loops = loops),
layout = "circle",
Expand Down
2 changes: 1 addition & 1 deletion R/model_parsers.R
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
# type is the type of data
.aggregate_results_data_table <- function(dat, model, type) {
value <- time <- NULL # local binding
common_terms <- c("group","phase","trial_type","trial","block_size","s1")
common_terms <- c("group", "phase", "trial_type", "trial", "block_size", "s1")
fmap <- formula_map()
form <- c(common_terms, fmap[[model]][[type]])
dat <- data.table::data.table(dat)
Expand Down

0 comments on commit 0caa3e6

Please sign in to comment.