开始使用免费开始使用

跨时间的指标

到目前为止,您一直通过查看出度来寻找会带动其他购买的产品。不过,在上一节课之前,我们只是在观察某一时刻的单个快照。现在的问题是:这些产品在每个时间步的出度是否相似?毕竟,某个产品之所以能带动其他购买,可能是偶然因素;如果它在时间上更稳定,就可能表明该产品持续推动了联购。为回答这个问题,我们将基于之前的代码,生成一个列表,其中每个时间步都有一张图。

本练习是课程的一部分

案例研究:用 R 进行网络分析

查看课程

交互式实操练习

通过完成这段示例代码来试试这个练习。

# 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(___, ___(___))
)
编辑并运行代码