Skip to contents

Generate a plot of an associatoR object.

Usage

# S3 method for class 'associatoR'
plot(associations, facet_by = NULL, top_n = 5, ...)

Arguments

associations

an associatoR object containing association data as generated by ar_import with targets defined by ar_set_targets.

facet_by

a character vector of variable names to generate facets.

top_n

a numeric scalar

...

optional logical comparisons to filter the responses before computing frequencies.

Value

Returns a ggplot plot object.

Examples

ar_import(intelligence,
          participant = participant_id,
          cue = cue,
          response = response,
          participant_vars = c(gender, education),
          response_vars = c(response_position, response_level)) %>%
  ar_set_targets("cues") %>%
  plot(facet_by = "gender", top_n = 10)


ar_import(intelligence,
          participant = participant_id,
          cue = cue,
          response = response,
          participant_vars = c(gender, education),
          response_vars = c(response_position, response_level)) %>%
  ar_set_targets("cues") %>%
  plot(facet_by = "education", top_n = 10, gender == "female")