tidyverse not loaded, it says “namespace ‘vctrs’ 0.2.0 is already loaded, but >= 0.2.1 is required”

This has already been answered above, and I am leaving my notes for other “beginners” that may have run into the same thing. I encountered this issue after installing tidymodels (have since removed). Had issue with rlang first: namespace ‘rlang’ 0.4.7 is already loaded, but >= 0.4.10 is required remove.packages(“rlang”), install.packages(“rlang”) Then had issue with … Read more

data.table equivalent of tidyr::complete()

I reckon that the philosophy of data.table entails fewer specially-named functions for tasks than you’ll find in the tidyverse, so some extra coding is required, like: res = setDT(df)[ CJ(person = person, observation_id = observation_id, unique=TRUE), on=.(person, observation_id) ] After this, you still have to manually handle the filling of values for missing levels. We … Read more