Metrics through time
So far, we have been looking at products that drive other purchases by examining their out degree. However, up until the last lesson we've just been looking at a single snapshot in time. One question is, do these products show similar out degrees at each time step? After all, a product driving other purchases could just be idiosyncratic, or it if were more stable through time it might indicate that product could be responsible for driving co-purchases. To get at this question, we're going to build off the code we've already walked through that generates a list with a graph at each time step.
This exercise is part of the course
Case Studies: Network Analysis in R
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Loop over time graphs calculating out degree
degree_count_list <- lapply(___,___, mode = ___)
# Flatten it
degree_count_flat <- ___
degree_data <- data.frame(
# Use the flattened counts
degree_count = ___,
# Use the names of the flattened counts
vertex_name = names(___),
# Repeat the dates by the lengths of the count list
date = rep(___, ___(___))
)