GraphicsPrinciples/tutorial-viz-com

Questions about the code

Opened this issue · 0 comments

KGmax commented

When I run 404_case4.R , a question comes up that I don't quite understand as a newbie. I hope I can get your help.

code:

emm1df <- as.data.frame(ests) %>% mutate(Visit = contrasts.Visit, subgroup = ifelse(contrasts.subgroup == 0, "Negative", "Positive"), y = -1*contrasts.estimate ) %>% left_join(vis_dat) %>% mutate( Visit = contrasts.Visit, Week = ifelse(subgroup == "Positive", NOMTIME - 0.15, NOMTIME + 0.05 ) )

Error in mutate():
ℹ In argument: Visit = contrasts.Visit.
Caused by error:
! object 'contrasts.Visit' not found
Run rlang::last_trace() to see where the error occurred.
Warning message:
In as.data.frame.emm_list(ests) :
Note: 'as.data.frame' has combined your 2 sets of results into one object,
and this affects things like adjusted P values. Refer to the annotations.

Anyway, I don't understand what the problem is.

Thank you.