Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use geom_line to connect samples with same specified ID #319

Closed
wipperman opened this issue Oct 8, 2019 · 3 comments
Closed

Use geom_line to connect samples with same specified ID #319

wipperman opened this issue Oct 8, 2019 · 3 comments
Labels
enhancement 🔥 New feature or request good first issue ❤️ Good for newcomers

Comments

@wipperman
Copy link

Hello,

Thank you for the wonderful package. I have a simple question that would apply to most of the functions within the ggstatsplot package. Is there an easy way to connect dots from the same sample, by specifying specifically the column that contains the sample ID variable? With my own data, I have tried adding geom_line() after the ggwithinstats() argument, but this didn't seem to work.

For example, I see in this example from the tutorial the dotted lines produced presumably between the 'subject' column header in the input table. Sometimes this header is called something else, so just allowing a user to specify the variable used to connect two (or more) points from the same "subject" would be a nice feature. Also, allowing for "missing" data, in the sense that it's often the case that some data is missing, so even if most subjects from two or more groups (i.e., several timepoints from a longitudinal study) are grouped and could be connected with a line, some datapoints from a particular subject might be missing. Perhaps this is a feature and I just can't find it, but I think it would be helpful to the overall use of the package.

Thanks so much!
Matt

# common setup
set.seed(123)

# getting data in tidy format
data_bugs <- ggstatsplot::bugs_long %>%
  dplyr::filter(.data = ., region %in% c("Europe", "North America"))

# plot
ggstatsplot::grouped_ggwithinstats(
  data = dplyr::filter(data_bugs, condition %in% c("LDLF", "LDHF")),
  x = condition,
  y = desire,
  xlab = "Condition",
  ylab = "Desire to kill an artrhopod",
  grouping.var = region,
  outlier.tagging = TRUE,
  outlier.label = education,
  ggtheme = hrbrthemes::theme_ipsum_tw(),
  ggstatsplot.layer = FALSE,
  messages = FALSE
)
@fmmattioni
Copy link

I would love to see that too!

@handrigg
Copy link

I agree, this feature would be useful.

@IndrajeetPatil
Copy link
Owner

Closing in favor of #483

Hopefully this will be implemented in the next scheduled release 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🔥 New feature or request good first issue ❤️ Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants