Skip to content

Commit

Permalink
updated link functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyparsons committed Oct 12, 2016
1 parent fa7fef9 commit e09727e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions instat/static/InstatObject/R/Backend_Components/link.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ link$set("public", "equals", function(compare_link) {
&& self$to_data_frame == compare_link$to_data_frame
&& self$type == compare_link$type) {
if(self$type == keyed_link_label) {
#print(self$calculation$parameters)
#print(compare_link$calculation$parameters)
if(setequal(self$calculation$parameters, compare_link$calculation$parameters) && setequal(names(self$calculation$parameters), names(compare_link$calculation$parameters))) {
for(name in names(compare_link$calculation$parameters)) {
if(compare_link$calculation$parameters[[name]] != self$calculation$parameters[[name]]) return(FALSE)
for(factor_col in compare_link$calculation$parameters) {
if(!factor_col %in% self$calculation$parameters) return(FALSE)
}
return(TRUE)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ data_object$set("public", "merge_data", function(new_data, by = NULL, type = "le
instat_object$set("public", "append_summaries_to_data_object", function(out, data_name, columns_to_summarise, summaries, factors = c(), summary_name, calc, calc_name = "") {
if(!is.character(data_name)) stop("data_name must be of type character")
factors_list <- factors
names(factors_list) <- factors
link_calc <- calculation$new(type = "summary", parameters = factors_list)
link_obj <- link$new(from_data_frame = data_name, type = keyed_link_label, calculation = link_calc)
exists = FALSE
Expand Down

0 comments on commit e09727e

Please sign in to comment.