一直在阅读 Julia Silge 和 David Robinson 的 Tidytext Mining with R - https://www.tidytextmining.com/nasa.html - 并为如何根据频率 (n) 调整节点大小感到困惑。尝试了以下代码...
library(widyr)
set.seed(1234)
title_word_pairs %>%
filter(n >= 250) %>%
graph_from_data_frame() %>%
ggraph(layout = "fr") +
geom_edge_link(aes(edge_alpha = n, edge_width = n), edge_colour =
"royalblue") +
geom_node_point(aes(size = n)) + scale_size(range = c(2,10)) +
geom_node_text(aes(label = name), repel = TRUE,
point.padding = unit(0.2, "lines")) +
theme_void()
...并收到此错误...
Error: Column `size` must be a 1d atomic vector or a list
Call `rlang::last_error()` to see a backtrace
任何想法或想法将不胜感激。