Without a reproducible example I went through the link and made a small dataset to illustrate my solution.
Libraries
library(dplyr)
library(widyr)
library(ggplot2)
library(igraph)
library(ggraph)
Data
title_word_pairs1 <- structure(list(item1 = c("phase", "ges", "phase", "1", "phase",
"phase", "ges", "disc", "phase", "phase"),
item2 = c("ii", "disc", "system", "version", "space",
"based", "degree", "degree", "low", "power"),
n = c(2498, 1201, 948, 678, 637, 601,
582, 582, 480, 441)),
row.names = c(NA, -10L),
class = c("tbl_df", "tbl", data.frame"))
Using ggplot
data to create a list of colors:
Here, I created the igraph
without nodes, text, etc. and then used its data to make a list of desired colors.
set.seed(1)
g <- title_word_pairs1 %>%
filter(nnn >= 250) %>%
graph_from_data_frame() %>%
ggraph(layout = "fr")
mcolor <- g$data %>% mutate(mcolor = if_else(name %in% c("low", "space"),
"blue", "black")) %>% select(mcolor)
g +
geom_edge_link(aes(edge_alpha = n, edge_width = n)
, edge_colour = "cyan4") +
geom_node_point(size = 5) +
geom_node_text(aes(label = name), repel = TRUE
, point.padding = unit(0.2, "lines"), colour=mcolor$mcolor) +
theme_void() + theme(legend.position="none")

Created on 2019-05-19 by the reprex package (v0.2.1)
Manipulating ggplot_build
object colors to desired colors:
What I basically do is making the plot and then manipulating the ggplot
object to get the desired colors.
set.seed(1)
g <- title_word_pairs1 %>%
filter(n >= 250) %>%
graph_from_data_frame() %>%
ggraph(layout = "fr") +
geom_edge_link(aes(edge_alpha = n, edge_width = n)
, edge_colour = "cyan4") +
geom_node_point(size = 5) +
geom_node_text(aes(label = name), repel = TRUE
, point.padding = unit(0.2, "lines"), colour="red") +
theme_void() + theme(legend.position="none")
g

gg <- ggplot_build(g)
gg$data[[3]] <- gg$data[[3]] %>%
mutate(colour = if_else(label %in% c("low", "space"),
"blue", "black"))
gt <- ggplot_gtable(gg)
plot(gt)

Created on 2019-05-18 by the reprex package (v0.2.1)