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

How to get rownames from anova() #38

Open
steveharoz opened this issue Nov 29, 2022 · 2 comments
Open

How to get rownames from anova() #38

steveharoz opened this issue Nov 29, 2022 · 2 comments

Comments

@steveharoz
Copy link

When rownames_to_column() is called on the anova results, the text is replaced with numbers.

# make some data
expand.grid(
  aaa = LETTERS[1:4],
  bbb = LETTERS[1:4],
  subject = 1:10
) %>% 
  mutate_all(factor) %>% 
  mutate(measure = rnorm(n())) %>% 
  
# ART ANOVA
art(measure ~ aaa * bbb + Error(subject/bbb), .) %>% 
  anova() %>% 
  
# get row names as a column
  rownames_to_column()

There are numbers instead of text:
image

@steveharoz
Copy link
Author

Workaround: Calling ... %>% cbind(.) will put the rowname in a column named Term.

@mjskay
Copy link
Owner

mjskay commented Nov 30, 2022

Yeah, it's admittedly a bit obscure, but that column is there already and can be referred to by name (pass the data structure to str() to see it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants