Lets pretend I have something like this:
df <- data.frame( PERSON = c("Peter", "Peter", "Marcel" , "Lisa", &q
The complete takes the first argument as 'data', followed by the columns to expand. By default, the fill is NA, but we can change it to 0 by specifying it in a list.
complete
fill
list
complete(df, PERSON, FRUIT, fill = list(A=0, B = 0))