Add columns containing text data to YouTube activity network dataframes
Source:R/AddText.R
AddText.actor.youtube.Rd
Text comments are added to the network as node attributes.
Text comments are added to the network as edge attributes. References to actors are detected at the beginning of comments and edges redirected to that actor instead if they differ from the top-level comment author.
Arguments
- net
A named list of dataframes
nodes
andedges
generated byCreate
.- data
A dataframe generated by
Collect
.- ...
Additional parameters passed to function. Not used in this method.
- writeToFile
Logical. Write data to file. Default is
FALSE
.- verbose
Logical. Output additional information. Default is
TRUE
.- repliesFromText
Logical. If comment text for an edge begins with
screen_name
change the edge to be directed toscreen_name
- if different from the top level comment author that the reply comment was posted to. Default isFALSE
.- atRepliesOnly
Logical. Comment
screen_names
must begin with an '@' symbol to be redirected. Default isTRUE
.
Value
Network as a named list of two dataframes containing $nodes
and $edges
including columns
containing text data.
Network as a named list of two dataframes containing $nodes
and $edges
including columns
containing text data.
Examples
if (FALSE) { # \dontrun{
# add text to an activity network
net_activity <- collect_yt |>
Create("activity") |> AddText(collect_yt)
# network
net_activity$nodes
net_activity$edges
} # }
if (FALSE) { # \dontrun{
# add text to an actor network ignoring references to actors at
# the beginning of comment text
net_actor <- collect_yt |>
Create("actor") |>
AddText(collect_yt, repliesFromText = FALSE)
# network
net_actor$nodes
net_actor$edges
} # }