My question is inspired by this post:
I would like to understand how this two dataframes (one of them is a subset from the other) can be joined together if a first dataframe has got 15 rows:
vas = data_frame( user = rep(letters[1:n_users], each = 3), group = rep(c("baseline", "early", "late" ),n_users), vas = round(rgamma(n_users*3, 10,1.4 )) )
and the other has got 5 rows:
vas_baseline <- vas_1 %>% filter(group == "baseline")
vas_1 = vas %>% mutate(vas = vas * 2) vas_with_diff <- vas_1 %>% left_join(vas_baseline, by = c("user")) %>% mutate(vas_difference = vas.x - vas.y)
We finally got a new dataframe with 15 rows and 6 columns (no NAs - surprisingly to me?):
I apologize fort a naive question, but would it be possible to see where all cells (values) from
"vas_baseline" are situated now in "vas_with_diff" ? Sort of like maybe conditional formatting in an Excel way.
What would have happened if "vas_baseline" had more columns than "vas_1" ?