Great package! Thanks for the work.
I can make everything work if I load ggplot2 interactively but that's not a real fix because the package doesn't load ggplot, just imports it and ggnetwork. I suspect you need to explicitly import Stat
from ggplot2...something like importFrom ggplot2 layer GeomPoint Stat
but this is unconfirmed
idat <- structure(list(x = structure(c(0.71018852180629, 0.8605306826431,
0.924209068560679, 0.285775361017905, 0.664863156729071, 0.487145768921997,
1, 0.832231634124478, 0.422308506307687, 0.762751881472008, 0.0938322873057752,
0.0261833664908076, 0.298901171980893, 0.701456761564214, 0,
0.165534692152668, 0.705929523042674, 0.47582084015162, 0.904864637947938,
0.266173069467932, 0.0938322873057752, 0.285775361017905, 0.285775361017905,
0.487145768921997, 0.487145768921997, 0.664863156729071, 0.664863156729071,
0.71018852180629, 0.71018852180629, 0.71018852180629, 0.71018852180629,
0.71018852180629, 0.71018852180629, 0.832231634124478, 0.8605306826431,
0.8605306826431, 0.8605306826431, 0.8605306826431, 0.924209068560679,
0.924209068560679, 1), .Dim = c(41L, 1L), .Dimnames = list(NULL,
NULL)), y = structure(c(0.334645431217957, 0.432671829817682,
0.353342528130734, 0.140553264183392, 0.144474680809364, 0.199584374433029,
0.510873652408072, 0.510678506104081, 0.0134895225339282, 0,
0.78879924632742, 0.528252398565063, 0.272329523655057, 0.524789125711111,
0.32914964854835, 0.67428118095733, 0.990339597882693, 1, 0.869509897438751,
0.949736961865797, 0.78879924632742, 0.140553264183392, 0.140553264183392,
0.199584374433029, 0.199584374433029, 0.144474680809364, 0.144474680809364,
0.334645431217957, 0.334645431217957, 0.334645431217957, 0.334645431217957,
0.334645431217957, 0.334645431217957, 0.510678506104081, 0.432671829817682,
0.432671829817682, 0.432671829817682, 0.432671829817682, 0.353342528130734,
0.353342528130734, 0.510873652408072), .Dim = c(41L, 1L), .Dimnames = list(
NULL, NULL)), na.x = c(FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
), vertex.names = structure(c(3L, 8L, 9L, 4L, 10L, 13L, 16L,
14L, 6L, 18L, 20L, 5L, 12L, 1L, 7L, 2L, 19L, 17L, 11L, 15L, 20L,
4L, 4L, 13L, 13L, 10L, 10L, 3L, 3L, 3L, 3L, 3L, 3L, 14L, 8L,
8L, 8L, 8L, 9L, 9L, 16L), .Label = c("also", "four", "going",
"governor", "jobs", "just", "know", "make", "people", "president",
"right", "romney", "said", "sure", "think", "want", "well", "will",
"world", "years"), class = "factor"), xend = structure(c(0.71018852180629,
0.8605306826431, 0.924209068560679, 0.285775361017905, 0.664863156729071,
0.487145768921997, 1, 0.832231634124478, 0.422308506307687, 0.762751881472008,
0.0938322873057752, 0.0261833664908076, 0.298901171980893, 0.701456761564214,
0, 0.165534692152668, 0.705929523042674, 0.47582084015162, 0.904864637947938,
0.266173069467932, 0.165534692152668, 0.487145768921997, 0.298901171980893,
0.298901171980893, 0.422308506307687, 0.487145768921997, 0.762751881472008,
0.8605306826431, 0.924209068560679, 0.664863156729071, 0.487145768921997,
0.832231634124478, 0.701456761564214, 0.701456761564214, 0.924209068560679,
0.832231634124478, 1, 0.701456761564214, 1, 0.832231634124478,
0.832231634124478), .Dim = c(41L, 1L), .Dimnames = list(NULL,
NULL)), yend = structure(c(0.334645431217957, 0.432671829817682,
0.353342528130734, 0.140553264183392, 0.144474680809364, 0.199584374433029,
0.510873652408072, 0.510678506104081, 0.0134895225339282, 0,
0.78879924632742, 0.528252398565063, 0.272329523655057, 0.524789125711111,
0.32914964854835, 0.67428118095733, 0.990339597882693, 1, 0.869509897438751,
0.949736961865797, 0.67428118095733, 0.199584374433029, 0.272329523655057,
0.272329523655057, 0.0134895225339282, 0.199584374433029, 0,
0.432671829817682, 0.353342528130734, 0.144474680809364, 0.199584374433029,
0.510678506104081, 0.524789125711111, 0.524789125711111, 0.353342528130734,
0.510678506104081, 0.510873652408072, 0.524789125711111, 0.510873652408072,
0.510678506104081, 0.510678506104081), .Dim = c(41L, 1L), .Dimnames = list(
NULL, NULL)), na.y = c(NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
), weight = c(25, 19.2796610169492, 16.228813559322, 14.0360169491525,
16.7055084745763, 12.3199152542373, 15.9427966101695, 12.4152542372881,
7.36228813559322, 8.02966101694915, 6.40889830508475, 5.64618644067797,
5.16949152542373, 3.54872881355932, 4.21610169491525, 4.69279661016949,
2.6906779661017, 2.5, 3.54872881355932, 3.07203389830508, 0.474025974025974,
0.227272727272727, 0.811688311688312, 0.155844155844156, 0.155844155844156,
0.214285714285714, 0.155844155844156, 0.324675324675325, 0.253246753246753,
0.155844155844156, 0.175324675324675, 0.25974025974026, 0.175324675324675,
0.175324675324675, 0.25974025974026, 1, 0.324675324675325, 0.188311688311688,
0.155844155844156, 0.175324675324675, 0.246753246753247), width = c(NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, 2.37012987012987, 1.13636363636364, 4.05844155844156,
0.779220779220779, 0.779220779220779, 1.07142857142857, 0.779220779220779,
1.62337662337662, 1.26623376623377, 0.779220779220779, 0.876623376623377,
1.2987012987013, 0.876623376623377, 0.876623376623377, 1.2987012987013,
5, 1.62337662337662, 0.941558441558442, 0.779220779220779, 0.876623376623377,
1.23376623376623)), .Names = c("x", "y", "na.x", "vertex.names",
"xend", "yend", "na.y", "weight", "width"), row.names = c("1",
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",
"14", "15", "16", "17", "18", "19", "20", "33", "61", "71", "111",
"121", "131", "141", "171", "181", "191", "201", "21", "22",
"24", "25", "26", "27", "28", "30", "31", "32"), class = "data.frame")
ggplot2::ggplot(idat, ggplot2::aes(x = x, y = y, xend = xend, yend = yend)) +
ggnetwork::geom_edges(color = 'gray80', ggplot2::aes(size = width)) +
ggnetwork::geom_nodes(color = 'orange', ggplot2::aes(size = weight*5)) +
ggnetwork::geom_nodetext(ggplot2::aes(label = vertex.names))
## Error in eval(expr, envir, enclos) : object 'Stat' not found