jwdink / eyetrackingR

This package is designed to make dealing with eye-tracking data easier. It addresses tasks along the pipeline from raw data to analysis and visualization.
http://eyetrackingr.com
Other
82 stars 20 forks source link

Throw warning in analyze_time_clusters() if user sets within_subj to FALSE but passes a paired=TRUE parameter (or vice versa) #49

Closed brockf closed 8 years ago

jwdink commented 8 years ago

Is this not already happening? From lines 128-140 in time_cluster_data.R:

if (attrs$test %in% c("t.test", "wilcox.test")) {
    paired <- eval(dots[["paired"]]$expr)
    if (within_subj==TRUE) {
      # if within_subj is true, we need to confirm they overrode default
      if (!identical(paired, TRUE)) stop("For ", attrs$test, ", if 'within_subj' is TRUE, then 'paired' should also be TRUE.")
    } else {
      # if within_subj is false, we just need to confirm they didn't set paired = TRUE
      if (identical(paired, TRUE)) stop("For ", attrs$test, ", if 'within_subj' is FALSE, then 'paired' should also be FALSE.")
    }
  } else if (attrs$test %in% c("lm","glm")) {
    if (within_subj == TRUE) warning("For lm, 'within_subj' should probably be FALSE.")
  }
brockf commented 8 years ago

Can confirm this is not happening. Can currently execute this code:

df_timeclust <- make_time_cluster_data(response_time_dataframe, test= "t.test", paired=FALSE, predictor_column = "factor", threshold = threshold_t, within_subj = TRUE)

jwdink commented 8 years ago

Specifying within_subj in make_time_cluster_data doesn't do anything. It's not an arg to that function.

brockf commented 8 years ago

Haha good call.