Description Usage Arguments Details Author(s) Examples
A proto_net is a list containing two data frames named edges and nodes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | as_proto_net(
tweet_df,
target_class = c("user", "hashtag", "url", "media"),
all_status_data = FALSE,
all_user_data = FALSE,
as_tibble = tweetio_as_tibble(),
...
)
## S3 method for class 'data.frame'
as_proto_net(
tweet_df,
target_class = c("user", "hashtag", "url", "media"),
all_status_data = FALSE,
all_user_data = FALSE,
as_tibble = tweetio_as_tibble(),
...
)
## S3 method for class 'data.table'
as_proto_net(
tweet_df,
target_class = c("user", "hashtag", "url", "media"),
all_status_data = FALSE,
all_user_data = FALSE,
as_tibble = tweetio_as_tibble(),
...
)
|
tweet_df |
A data frame of tweets, as obtained by |
target_class |
|
all_status_data |
|
all_user_data |
|
as_tibble |
|
... |
Arguments passed to or from other methods. |
In a proto_net, users are always to source/from/tail side of dyads. target_class
defaults to "user", which creates edges where users on both sides of dyads.
However users can also share edges with "hashtag"s, "url"s, or "media", so
those values are also valid to provide to target_class to create two-mode/bipartite
proto_nets.
The edges of a proto_net represent the statuses that form each tie, and status-specific
columns are attached to the edges.
Casing
Twitter hashtags are not case-sensitive, so if target_class is "hashtag" they will
be cast to lower-case so they can represent the same node in downstream tasks.
URLs (after the domain) can be case-sensitive, so they are left as-is.
If you decide to cast URLs to lower-case yourself, exercise caution with Twitter's media URLs, as they contain a case-sensitive hash.
all_status_data and all_user_data default to FALSE as they can be performance
bottlenecks for large data sets, but they provide a way of building richly decorated
networks with the maximum amount of attribute data embedded in the graph structure.
Brendan Knapp brendan.g.knapp@nps.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | path_to_tweet_file <- example_tweet_file()
tweet_df <- read_tweets(path_to_tweet_file)
tweet_df %>%
as_proto_net(as_tibble = TRUE)
tweet_df %>%
as_proto_net(target_class = "hashtag", as_tibble = TRUE)
tweet_df %>%
as_proto_net(target_class = "url", as_tibble = TRUE)
tweet_df %>%
as_proto_net(target_class = "media", as_tibble = TRUE)
tweet_df %>%
as_proto_net(all_status_data = TRUE, all_user_data = TRUE, as_tibble = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.