From b0af46b8d45438eee451662a5169243ad31b3e6b Mon Sep 17 00:00:00 2001 From: bryn-g <22555149+bryn-g@users.noreply.github.com> Date: Tue, 16 Aug 2022 14:17:19 +1000 Subject: [PATCH] Updated documentation --- DESCRIPTION | 4 +- NEWS.md | 7 +- R/Authenticate.twitter.R | 2 +- R/utils_youtube.R | 2 +- R/wrappers.R | 3 - README.Rmd | 2 +- README.md | 224 +++++++------- _pkgdown.yaml | 6 +- cran-comments.md | 12 +- docs/404.html | 14 +- docs/CODE_OF_CONDUCT.html | 14 +- docs/LICENSE-text.html | 14 +- docs/articles/Intro-to-vosonSML.html | 24 +- docs/articles/index.html | 14 +- docs/authors.html | 18 +- docs/extra.css | 5 + docs/index.html | 240 +++++++-------- docs/news/index.html | 23 +- docs/pkgdown.yml | 2 +- docs/reference/AddText.activity.reddit.html | 14 +- docs/reference/AddText.activity.twitter.html | 14 +- docs/reference/AddText.actor.reddit.html | 14 +- docs/reference/AddText.actor.twitter.html | 14 +- docs/reference/AddText.actor.youtube.html | 14 +- docs/reference/AddText.html | 14 +- docs/reference/AddText.semantic.twitter.html | 14 +- docs/reference/AddText.twomode.twitter.html | 14 +- docs/reference/AddUserData.actor.twitter.html | 14 +- docs/reference/AddUserData.html | 14 +- .../AddUserData.twomode.twitter.html | 14 +- .../reference/AddVideoData.actor.youtube.html | 14 +- docs/reference/AddVideoData.html | 14 +- docs/reference/Authenticate.html | 14 +- docs/reference/Authenticate.reddit.html | 14 +- docs/reference/Authenticate.twitter.html | 18 +- docs/reference/Authenticate.web.html | 14 +- docs/reference/Authenticate.youtube.html | 14 +- docs/reference/Collect.html | 14 +- docs/reference/Collect.reddit.html | 14 +- docs/reference/Collect.search.twitter.html | 14 +- docs/reference/Collect.timeline.twitter.html | 14 +- docs/reference/Collect.web.html | 14 +- docs/reference/Collect.youtube.html | 14 +- docs/reference/Create.activity.reddit.html | 14 +- docs/reference/Create.activity.twitter.html | 14 +- docs/reference/Create.activity.web.html | 14 +- docs/reference/Create.activity.youtube.html | 14 +- docs/reference/Create.actor.reddit.html | 14 +- docs/reference/Create.actor.twitter.html | 14 +- docs/reference/Create.actor.web.html | 14 +- docs/reference/Create.actor.youtube.html | 14 +- docs/reference/Create.html | 14 +- docs/reference/Create.semantic.twitter.html | 14 +- docs/reference/Create.twomode.twitter.html | 14 +- docs/reference/Graph.html | 14 +- docs/reference/ImportRtweet.html | 14 +- docs/reference/Merge.html | 14 +- docs/reference/MergeFiles.html | 14 +- docs/reference/auth_twitter_app.html | 14 +- docs/reference/auth_twitter_dev.html | 14 +- docs/reference/auth_twitter_user.html | 20 +- docs/reference/index.html | 14 +- docs/reference/vosonSML-package.html | 18 +- man/Authenticate.twitter.Rd | 2 +- man/auth_twitter_user.Rd | 3 - man/vosonSML-package.Rd | 2 +- pkgdown/extra.css | 5 + vignettes/Intro-to-vosonSML.R | 278 ++++++++---------- vignettes/Intro-to-vosonSML.Rmd | 11 +- 69 files changed, 780 insertions(+), 781 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1232340..0851548 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: vosonSML -Version: 0.32.6 +Version: 0.32.7 Title: Collecting Social Media Data and Generating Networks for Analysis Description: A suite of easy to use functions for collecting social media - data and generating networks for analysis. Supports Twitter, Youtube, + data and generating networks for analysis. Supports Twitter, YouTube, Reddit and web site data sources. Type: Package Imports: diff --git a/NEWS.md b/NEWS.md index 5a6989f..b352c40 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,10 @@ -# vosonSML 0.32.6 +# vosonSML 0.32.7 ## Major Changes - Re-wrote and modified `vosonSML` `Twitter` functions to support major changes made in `rtweet` release version 1.0.2. +- Added an `endpoint` parameter to the `Twitter` `Collect` function. It is set to `search` by default, which is the + usual collect behaviour, but can also now be set to `timeline` to collect user timelines instead. See + `Collect.timeline.twitter()` for parameters. - Changed output message system. `vosonSML` functions are now silent by default. Using the `verbose` parameter will again print function output. - Changed output messages to use the `message()` function instead of the `cat()` function by default. Setting the global @@ -22,7 +25,7 @@ for all users in the network. - Twitter data collection now returns a named list of two dataframes containing `tweets` and `users`. - Removed the `ImportData` function and replaced it with `ImportRtweet()` for `rtweet` version 1.0 format data. -- Added `Merge()` and `MergeFiles()` functions to support the merging of collected data from seperate operations. These +- Added `Merge()` and `MergeFiles()` functions to support the merging of collected data from separate operations. These functions support input of multiple Collect objects or `.RDS` files, automatically detect the datasource type and support the `writeToFile` parameter for file output of merged data. diff --git a/R/Authenticate.twitter.R b/R/Authenticate.twitter.R index 8cb8349..f59265b 100644 --- a/R/Authenticate.twitter.R +++ b/R/Authenticate.twitter.R @@ -17,7 +17,7 @@ #' method for this package and data collection. #' #' The twitter OAuth process is described here: -#' \url{https://developer.twitter.com/en/docs/basics/authentication/overview/oauth}. +#' \url{https://developer.twitter.com/en/docs/authentication/overview}. #' #' @note \pkg{vosonSML} uses the \pkg{rtweet} package for twitter data collection and also gratefully acknowledges the #' techniques and code written by its authors reproduced in this package for creating twitter API access tokens. diff --git a/R/utils_youtube.R b/R/utils_youtube.R index 51ea331..081b840 100644 --- a/R/utils_youtube.R +++ b/R/utils_youtube.R @@ -6,7 +6,7 @@ get_yt_video_ids <- function(x) { url_regex_2 <- paste0("^(?:https://)?(?:www\\.)?youtube\\.com/watch\\?v=(", id_regex, ")?/{0,1}$") url_regex_3 <- paste0("^(?:https://)?(?:www\\.)?youtube\\.com/shorts/(", id_regex, ")?/{0,1}$") - x <- stringr::str_remove(x, "t=[0-9]+?s$") + x <- stringr::str_remove(x, "&t=[0-9]+?s$") y <- stringr::str_match( as.character(x), diff --git a/R/wrappers.R b/R/wrappers.R index 20edf0d..4315a9b 100644 --- a/R/wrappers.R +++ b/R/wrappers.R @@ -97,9 +97,6 @@ auth_twitter_dev <- #' developer). The authentication object with token produced from this method allows the user to access the API within #' their own user-context and rate-limits. #' -#' The twitter OAuth process is described here: -#' \url{https://developer.twitter.com/en/docs/basics/authentication/overview/oauth}. -#' #' @note \pkg{vosonSML} uses the \pkg{rtweet} package for twitter data collection and also gratefully acknowledges the #' techniques and code written by its authors reproduced in this package for creating twitter API access tokens. #' diff --git a/README.Rmd b/README.Rmd index ca58f1d..507aa4f 100644 --- a/README.Rmd +++ b/README.Rmd @@ -19,7 +19,7 @@ library(vosonSML) The `vosonSML` R package is a suite of easy to use functions for collecting and generating different types of networks from social media data. The package supports the collection of data from `twitter`, `youtube` and `reddit`, as well as `hyperlinks` from web sites. Networks in the form of node and edge lists can be generated from collected data, -supplemented with additional metadata and used to create graphs for Social Network Analysis. +supplemented with additional metadata, and used to create graphs for Social Network Analysis. ## Installation Options diff --git a/README.md b/README.md index f289be4..bda1f03 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![CRAN_Monthly](https://cranlogs.r-pkg.org/badges/vosonSML)](https://CRAN.R-project.org/package=vosonSML) [![CRAN_Total](https://cranlogs.r-pkg.org/badges/grand-total/vosonSML)](https://CRAN.R-project.org/package=vosonSML) [![Github_Release](https://img.shields.io/github/release-pre/vosonlab/vosonSML.svg?logo=github)](https://github.com/vosonlab/vosonSML/releases) -[![Github_Dev](https://img.shields.io/static/v1?label=dev&message=v0.32.6&logo=github)](https://github.com/vosonlab/vosonSML) +[![Github_Dev](https://img.shields.io/static/v1?label=dev&message=v0.32.7&logo=github)](https://github.com/vosonlab/vosonSML) [![Last_Commit](https://img.shields.io/github/last-commit/vosonlab/vosonSML.svg?&logo=github)](https://github.com/vosonlab/vosonSML/commits/master) [![Build_Status](https://github.com/vosonlab/vosonSML/workflows/R-CMD-check/badge.svg)](https://github.com/vosonlab/vosonSML/actions) @@ -14,7 +14,7 @@ collecting and generating different types of networks from social media data. The package supports the collection of data from `twitter`, `youtube` and `reddit`, as well as `hyperlinks` from web sites. Networks in the form of node and edge lists can be generated from collected data, -supplemented with additional metadata and used to create graphs for +supplemented with additional metadata, and used to create graphs for Social Network Analysis. ## Installation Options @@ -29,7 +29,7 @@ Install the most recent release tag via GitHub: ``` r install.packages( - "https://github.com/vosonlab/vosonSML/releases/download/v0.30.6/vosonSML-0.30.6.tar.gz", + "https://github.com/vosonlab/vosonSML/releases/download/v0.32.7/vosonSML-0.32.7.tar.gz", repo = NULL, type = "source") ``` @@ -164,14 +164,14 @@ collect_tw <- auth_tw_bearer |> ## Collecting tweets for search query... ## Search term: #auspol ## Requested 100 tweets of 45000 in this search rate limit. -## Rate limit reset: 2022-08-15 08:36:17 +## Rate limit reset: 2022-08-16 02:51:42 ## ## tweet | status_id | created ## -------------------------------------------------------- -## Latest Obs | 1559092811261063168 | 2022-08-15 08:21:07 -## Earliest Obs | 1559092432754835456 | 2022-08-15 08:19:37 +## Latest Obs | 1559368518344200192 | 2022-08-16 02:36:41 +## Earliest Obs | 1559368223337746433 | 2022-08-16 02:35:30 ## Collected 100 tweets. -## RDS file written: ./vsml-data/2022-08-15_082120-TwitterData.rds +## RDS file written: ./vsml-data/2022-08-16_023645-TwitterData.rds ## Done. ``` @@ -189,14 +189,14 @@ collect_tw_tl <- auth_tw_bearer |> verbose = TRUE) ## Collecting timeline tweets for users... ## Requested 200 tweets of 150000 in this search rate limit. -## Rate limit reset: 2022-08-15 08:36:20 +## Rate limit reset: 2022-08-16 02:51:45 ## ## tweet | status_id | created ## -------------------------------------------------------- ## Latest Obs | 1557524390534754304 | 2022-08-11 00:28:46 -## Earliest Obs | 1417705934504161281 | 2021-07-21 04:40:09 +## Earliest Obs | 1417705961137999873 | 2021-07-21 04:40:15 ## Collected 200 tweets. -## RDS file written: ./vsml-data/2022-08-15_082123-TwitterData.rds +## RDS file written: ./vsml-data/2022-08-16_023648-TwitterData.rds ## Done. ``` @@ -240,10 +240,10 @@ net_activity <- collect_tw |> Create("activity", verbose = TRUE) ## Generating twitter activity network... ## ------------------------- ## collected tweets | 100 -## tweet | 13 -## retweet | 80 -## reply | 3 -## quote | 4 +## tweet | 15 +## retweet | 75 +## reply | 8 +## quote | 2 ## nodes | 170 ## edges | 100 ## ------------------------- @@ -253,21 +253,21 @@ net_activity <- collect_tw |> Create("activity", verbose = TRUE) ``` r g_activity <- net_activity |> Graph(writeToFile = TRUE, verbose = TRUE) ## Creating igraph network graph... -## GRAPHML file written: ./vsml-data/2022-08-15_182125-TwitterActivity.graphml +## GRAPHML file written: ./vsml-data/2022-08-16_123649-TwitterActivity.graphml ## Done. g_activity -## IGRAPH 40aebd9 DN-- 170 100 -- +## IGRAPH 4772699 DN-- 170 100 -- ## + attr: type (g/c), name (v/c), author_id (v/c), author_screen_name ## | (v/c), created_at (v/c), user_id (e/c), screen_name (e/c), created_at ## | (e/c), edge_type (e/c) -## + edges from 40aebd9 (vertex names): -## [1] 1559092811261063168->1558917830967341056 -## [2] 1559092809608491008->1559087915372003328 -## [3] 1559092791686225920->1559077872887025666 -## [4] 1559092776251191296->1559078091305402369 -## [5] 1559092775114911744->1558989941342093312 -## [6] 1559092773885997057->1559058438772396032 +## + edges from 4772699 (vertex names): +## [1] 1559368518344200192->1559357520879431680 +## [2] 1559368506218803200->1559353690158661632 +## [3] 1559368500900048896->1559348039827193856 +## [4] 1559368499884990470->1559362830876282880 +## [5] 1559368496554938368->1559368496554938368 +## [6] 1559368490439438336->1559317672424513537 ## + ... omitted several edges ``` @@ -284,14 +284,15 @@ net_actor <- collect_tw |> ## Generating twitter actor network... ## ------------------------- ## collected tweets | 100 -## tweet mention | 6 -## tweet | 13 -## retweet | 80 -## reply mention | 2 -## reply | 3 -## quote | 4 -## nodes | 155 -## edges | 108 +## tweet mention | 7 +## tweet | 15 +## retweet | 75 +## reply mention | 12 +## reply | 8 +## quote mention | 1 +## quote | 2 +## nodes | 160 +## edges | 120 ## ------------------------- ## Done. ``` @@ -299,21 +300,21 @@ net_actor <- collect_tw |> ``` r g_actor <- net_actor |> Graph(writeToFile = TRUE, verbose = TRUE) ## Creating igraph network graph... -## GRAPHML file written: ./vsml-data/2022-08-15_182125-TwitterActor.graphml +## GRAPHML file written: ./vsml-data/2022-08-16_123649-TwitterActor.graphml ## Done. g_actor -## IGRAPH 40e4413 DN-- 155 108 -- +## IGRAPH 47a7e9a DN-- 160 120 -- ## + attr: type (g/c), name (v/c), screen_name (v/c), status_id (e/c), ## | created_at (e/c), edge_type (e/c) -## + edges from 40e4413 (vertex names): -## [1] 1335039287406968833->1105659718528262144 -## [2] 1201034664 ->2224013870 -## [3] 1367342739881291780->711750460932141056 -## [4] 1442748397211975684->10346412 -## [5] 152164215 ->1029612428026204160 -## [6] 1604683951 ->1527920591080427520 -## [7] 2741019852 ->15112008 +## + edges from 47a7e9a (vertex names): +## [1] 1950356234 ->225762906 +## [2] 23557191 ->327347231 +## [3] 1469510327477805061->4265107032 +## [4] 723010310659956740 ->75961380 +## [5] 395042420 ->395042420 +## [6] 1132791264242307073->721940680038178816 +## [7] 164178673 ->164178673 ## + ... omitted several edges ``` @@ -340,17 +341,17 @@ net_semantic <- collect_tw |> ## Generating twitter semantic network... ## Removing terms and hashtags: #auspol ## ------------------------- -## retweets | 80 -## tokens | 388 -## removed specified | 20 -## removed users | 11 -## hashtag count | 17 -## hashtags unique | 17 -## term count | 141 -## terms unique | 127 -## top 20% hashtags n (>=1) | 17 -## top 10% terms n (>=1) | 127 -## nodes | 84 +## retweets | 75 +## tokens | 590 +## removed specified | 25 +## removed users | 27 +## hashtag count | 14 +## hashtags unique | 12 +## term count | 240 +## terms unique | 208 +## top 20% hashtags n (>=1) | 12 +## top 10% terms n (>=1) | 208 +## nodes | 83 ## edges | 107 ## ------------------------- ## Done. @@ -359,21 +360,21 @@ net_semantic <- collect_tw |> ``` r g_semantic <- net_semantic |> Graph(writeToFile = TRUE, verbose = TRUE) ## Creating igraph network graph... -## GRAPHML file written: ./vsml-data/2022-08-15_182126-TwitterSemantic.graphml +## GRAPHML file written: ./vsml-data/2022-08-16_123650-TwitterSemantic.graphml ## Done. g_semantic -## IGRAPH 418aaf2 UN-B 84 107 -- +## IGRAPH 485fca7 UN-B 83 107 -- ## + attr: type (g/c), name (v/c), type (v/c), n (v/n), from.type (e/c), ## | to.type (e/c), status_id (e/c) -## + edges from 418aaf2 (vertex names): -## [1] #thedrum --infrastructure #thedrum --services -## [3] #thedrum --heavily #thedrum --stretched -## [5] #thedrum --atm check --#breaking -## [7] daily --#breaking headlines--#breaking -## [9] news --#breaking stories --#breaking -## [11] property --#realestate property --#rba -## [13] property --#retailvacancies property --#covid19aus +## + edges from 485fca7 (vertex names): +## [1] surely --#hurley #hurley--embarrassed +## [3] #hurley--recognition #hurley--disclosures +## [5] #hurley--plastered #hurley--national +## [7] #hurley--international #hurley--media +## [9] #hurley--position #hurley--untenable +## [11] #hurley--atm #hurley--resignation +## [13] #hurley--correct #hurley--option ## + ... omitted several edges ``` @@ -393,11 +394,11 @@ net_2mode <- collect_tw |> ## Removing terms and hashtags: #auspol ## ------------------------- ## collected tweets | 100 -## removed specified | 20 -## users | 11 -## hashtags | 17 -## nodes | 43 -## edges | 28 +## removed specified | 25 +## users | 27 +## hashtags | 14 +## nodes | 53 +## edges | 41 ## ------------------------- ## Done. ``` @@ -405,21 +406,21 @@ net_2mode <- collect_tw |> ``` r g_2mode <- net_2mode |> Graph(writeToFile = TRUE, verbose = TRUE) ## Creating igraph network graph... -## GRAPHML file written: ./vsml-data/2022-08-15_182126-Twitter2mode.graphml +## GRAPHML file written: ./vsml-data/2022-08-16_123651-Twitter2mode.graphml ## Done. mask(g_2mode) -## IGRAPH 41a9594 DNWB 43 28 -- +## IGRAPH 488041b DNWB 53 41 -- ## + attr: type (g/c), name (v/c), type (v/c), user_id (v/c), screen_name ## | (v/c), status_id (e/c), created_at (e/c), is_retweet (e/l), is_quote ## | (e/l), is_reply (e/l), weight (e/n) -## + edges from 41a9594 (vertex names): -## [1] @lxxxxxxxxxxxet->#thedrum @lxxxxxxxxxxxil->#breaking -## [3] @uxxxxxxxxxrn ->#realestate @uxxxxxxxxxrn ->#rba -## [5] @uxxxxxxxxxrn ->#retailvacancies @uxxxxxxxxxrn ->#covid19aus -## [7] @uxxxxxxxxxrn ->#inflation @uxxxxxxxxxrn ->#property -## [9] @rxxxxxxxxxft ->#nopants @axxxxx7o ->#scottmorrison -## [11] @hxxxx60 ->@bxxat @axxxxxxxxxxin ->@oxxxxxxxxxxic +## + edges from 488041b (vertex names): +## [1] @hxxxxxxxxxvo ->@kxx5f @hxxxxxxxxxvo ->@pxxxxxkc +## [3] @hxxxxxxxxxvo ->#hurley @exxxxxxxfe ->@nxxxxxxxxea +## [5] @exxxxxxxfe ->@sxxxxxxay @exxxxxxxfe ->@bxxxxxxxbi +## [7] @exxxxxxxfe ->@oxxxpb @fxxxxxxxxxsy ->#lnpcorruptionparty +## [9] @wxxxxxxxxxxxaj->@uxxxxxxeg @9xxxxxxxxxx75 ->@axxxxxnc +## [11] @9xxxxxxxxxx75 ->#morrisongate @uxxxxxxae ->#scomo ## + ... omitted several edges ``` @@ -460,9 +461,15 @@ collect_yt <- auth_yt |> ## --------------------------------------------------------------- ## Video 2 of 2 ## --------------------------------------------------------------- -## -## ** Total comments collected for all videos 11. -## (Estimated API unit cost: 5) +## ** Creating dataframe from threads of lY0YLDZhT88. +## ** Collecting replies for 1 threads with replies. Please be patient. +## Comment replies 5 +## ** Collected replies: 5 +## ** Total video comments: 13 +## (Video API unit cost: 5) +## --------------------------------------------------------------- +## ** Total comments collected for all videos 24. +## (Estimated API unit cost: 10) ## Done. ``` @@ -481,12 +488,12 @@ comment. net_activity <- collect_yt |> Create("activity", verbose = TRUE) ## Generating youtube activity network... ## ------------------------- -## collected YouTube comments | 11 -## top-level comments | 10 -## reply comments | 1 -## videos | 1 -## nodes | 12 -## edges | 11 +## collected YouTube comments | 24 +## top-level comments | 18 +## reply comments | 6 +## videos | 2 +## nodes | 26 +## edges | 24 ## ------------------------- ## Done. ``` @@ -495,11 +502,11 @@ net_activity <- collect_yt |> Create("activity", verbose = TRUE) g_activity <- net_activity |> Graph() g_activity -## IGRAPH 422c3ba DN-- 12 11 -- +## IGRAPH 491270f DN-- 26 24 -- ## + attr: type (g/c), name (v/c), video_id (v/c), published_at (v/c), ## | updated_at (v/c), author_id (v/c), screen_name (v/c), node_type ## | (v/c), edge_type (e/c) -## + edges from 422c3ba (vertex names): +## + edges from 491270f (vertex names): ## [1] Ugw13lb0nCf4o4IKFb54AaABAg->VIDEOID:AQzZNIyjyWM ## [2] UgyJBlqZ64YnltQTOTt4AaABAg->VIDEOID:AQzZNIyjyWM ## [3] Ugysomx_apk24Pqrs1h4AaABAg->VIDEOID:AQzZNIyjyWM @@ -524,10 +531,10 @@ net_actor <- collect_yt |> Create("actor", verbose = TRUE) g_actor <- net_actor |> Graph() g_actor -## IGRAPH 423637e DN-- 11 12 -- +## IGRAPH 491c9a1 DN-- 23 26 -- ## + attr: type (g/c), name (v/c), screen_name (v/c), node_type (v/c), ## | video_id (e/c), comment_id (e/c), edge_type (e/c) -## + edges from 423637e (vertex names): +## + edges from 491c9a1 (vertex names): ## [1] UCb9ElH9tzEkG9OxDIiSYgdg->VIDEOID:AQzZNIyjyWM ## [2] UC0DwaB_wHNzUh-LA9sWXKYQ->VIDEOID:AQzZNIyjyWM ## [3] UCNHA8SkizJKauefYt1FHmjQ->VIDEOID:AQzZNIyjyWM @@ -568,7 +575,7 @@ collect_rd <- Authenticate("reddit") |> ## wcd8x5 | what is the name of the job I do? | datascience | 65 ## wcni2g | Ops research analyst vs data scientist. | datascience | 2 ## Collected 67 total comments. -## RDS file written: ./vsml-data/2022-08-15_082133-RedditData.rds +## RDS file written: ./vsml-data/2022-08-16_023656-RedditData.rds ## Done. ``` @@ -602,11 +609,11 @@ net_activity <- collect_rd |> Create("activity", verbose = TRUE) g_activity <- net_activity |> Graph() g_activity -## IGRAPH 45a859f DN-- 69 67 -- +## IGRAPH 4bc8a3d DN-- 69 67 -- ## + attr: type (g/c), name (v/c), thread_id (v/c), comm_id (v/c), ## | datetime (v/c), ts (v/n), subreddit (v/c), user (v/c), node_type ## | (v/c), edge_type (e/c) -## + edges from 45a859f (vertex names): +## + edges from 4bc8a3d (vertex names): ## [1] wcd8x5.1 ->wcd8x5.0 wcd8x5.2 ->wcd8x5.0 ## [3] wcd8x5.2_1 ->wcd8x5.2 wcd8x5.2_2 ->wcd8x5.2 ## [5] wcd8x5.2_2_1 ->wcd8x5.2_2 wcd8x5.2_2_1_1 ->wcd8x5.2_2_1 @@ -640,10 +647,10 @@ net_actor <- collect_rd |> Create("actor", verbose = TRUE) g_actor <- net_actor |> Graph() g_actor -## IGRAPH 45b37aa DN-- 35 69 -- +## IGRAPH 4bd3a8d DN-- 35 69 -- ## + attr: type (g/c), name (v/c), user (v/c), subreddit (e/c), thread_id ## | (e/c), comment_id (e/n), comm_id (e/c) -## + edges from 45b37aa (vertex names): +## + edges from 4bd3a8d (vertex names): ## [1] 1 ->7 2 ->7 3 ->2 4 ->2 2 ->4 4 ->2 5 ->4 4 ->5 1 ->4 4 ->1 ## [11] 6 ->7 7 ->6 8 ->7 9 ->8 7 ->9 9 ->7 7 ->8 10->7 11->10 7 ->11 ## [21] 12->7 7 ->12 13->11 14->13 9 ->13 13->9 9 ->13 15->7 7 ->15 16->7 @@ -755,7 +762,7 @@ net_activity <- net_activity |> g_activity <- net_activity |> Graph() g_activity -## IGRAPH 460d3ba DN-- 170 100 -- +## IGRAPH 4c2b041 DN-- 170 100 -- ## + attr: type (g/c), name (v/c), author_id (v/c), author_screen_name ## | (v/c), created_at (v/c), t.is_reply (v/l), t.is_quote (v/l), ## | t.is_retweet (v/l), t.full_text (v/c), t.hashtags (v/x), @@ -764,8 +771,8 @@ g_activity ## | t.retweeted.hashtags (v/x), vosonTxt_tweet (v/c), vosonTxt_hashtags ## | (v/c), user_id (e/c), screen_name (e/c), created_at (e/c), edge_type ## | (e/c) -## + edges from 460d3ba (vertex names): -## [1] 1559092811261063168->1558917830967341056 +## + edges from 4c2b041 (vertex names): +## [1] 1559368518344200192->1559357520879431680 ## + ... omitted several edges ``` @@ -816,7 +823,7 @@ net_actor_meta <- net_actor |> AddUserData(collect_tw, verbose = TRUE) names(net_actor_meta) ## [1] "edges" "nodes" "missing_users" nrow(net_actor_meta$missing_users) -## [1] 11 +## [1] 22 # add additional twitter user profile info net_actor_lookupmeta <- net_actor |> @@ -838,18 +845,19 @@ metadata. g_actor <- net_actor_meta |> Graph() g_actor -## IGRAPH 46987c8 DN-- 155 108 -- +## IGRAPH 4cc4a96 DN-- 160 120 -- ## + attr: type (g/c), name (v/c), screen_name (v/c), u.user_id (v/c), ## | u.name (v/c), u.screen_name (v/c), u.location (v/c), u.description ## | (v/c), u.url (v/c), u.protected (v/l), u.followers_count (v/n), ## | u.friends_count (v/n), u.listed_count (v/n), u.created_at (v/c), ## | u.favourites_count (v/n), u.verified (v/l), u.statuses_count (v/n), -## | u.default_profile (v/l), u.default_profile_image (v/l), -## | u.withheld_in_countries (v/x), u.profile_banner_url (v/c), u.derived -## | (v/c), u.withheld_scope (v/l), u.utc_offset (v/l), u.time_zone (v/l), -## | u.geo_enabled (v/l), u.lang (v/l), u.has_extended_profile (v/l), -## | status_id (e/c), created_at (e/c), edge_type (e/c) -## + edges from 46987c8 (vertex names): +## | u.profile_banner_url (v/c), u.default_profile (v/l), +## | u.default_profile_image (v/l), u.withheld_in_countries (v/x), +## | u.derived (v/c), u.withheld_scope (v/l), u.utc_offset (v/l), +## | u.time_zone (v/l), u.geo_enabled (v/l), u.lang (v/l), +## | u.has_extended_profile (v/l), status_id (e/c), created_at (e/c), +## | edge_type (e/c) +## + edges from 4cc4a96 (vertex names): ``` #### AddVideoData requests and adds video data to networks @@ -870,7 +878,7 @@ net_actor <- collect_yt |> names(net_actor) ## [1] "nodes" "edges" "videos" nrow(net_actor$videos) -## [1] 1 +## [1] 2 ``` `AddVideoData` function will also add a new dataframe to the @@ -881,11 +889,11 @@ called `videos`. g_actor <- net_actor |> Graph() g_actor -## IGRAPH 46bbd83 DN-- 11 12 -- +## IGRAPH 4ce955d DN-- 22 26 -- ## + attr: type (g/c), name (v/c), screen_name (v/c), node_type (v/c), ## | video_id (e/c), comment_id (e/c), edge_type (e/c), video_title (e/c), ## | video_description (e/c), video_published_at (e/c) -## + edges from 46bbd83 (vertex names): +## + edges from 4ce955d (vertex names): ## [1] UCb9ElH9tzEkG9OxDIiSYgdg->UCeiiqmVK07qhY-wvg3IZiZQ ## [2] UC0DwaB_wHNzUh-LA9sWXKYQ->UCeiiqmVK07qhY-wvg3IZiZQ ## [3] UCNHA8SkizJKauefYt1FHmjQ->UCeiiqmVK07qhY-wvg3IZiZQ diff --git a/_pkgdown.yaml b/_pkgdown.yaml index 72da804..0f89e07 100644 --- a/_pkgdown.yaml +++ b/_pkgdown.yaml @@ -36,15 +36,15 @@ navbar: - text: "Introduction to vosonSML" href: articles/Intro-to-vosonSML.html icon: far fa-file-alt + - text: "Egocentric Networks from Twitter timelines" + href: https://vosonlab.github.io/posts/2022-06-05-egocentric-networks-from-twitter-timelines + icon: far fa-file-alt - text: "Testing the bot status of users in Twitter networks collected via vosonSML" href: https://vosonlab.github.io/posts/2021-10-01-testing-bot-status-of-twitter-users icon: far fa-file-alt - text: "Hyperlink Networks with vosonSML" href: https://vosonlab.github.io/posts/2021-03-15-hyperlink-networks-with-vosonsml icon: far fa-file-alt - - text: "Creating Twitter Networks with vosonSML using rtweet Data" - href: https://vosonlab.github.io/posts/2021-02-11_twitter_vosonsml_from_rtweet - icon: far fa-file-alt vosonlab: icon: fa-flask fa-lg href: http://vosonlab.net/ diff --git a/cran-comments.md b/cran-comments.md index 3c10963..bd01e13 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,12 +1,8 @@ ## Test environments -* local MacOS X, R 4.0.2 -* local Windows 10, R 4.0.2 +* local MacOS X, R 4.2.0 +* local Windows 10, R 4.2.1 * Winbuilder (R-release, R-oldrelease) -* R-Devel r78868 Windows (Winbuilder) +* R-Devel r82719 Windows (Winbuilder) ## R CMD check results -0 errors | 0 warnings - -R-Devel error: -* checking package dependencies ... ERROR -Package required but not available: 'igraph' +0 errors | 0 warnings | 0 notes diff --git a/docs/404.html b/docs/404.html index 9c4fc73..c54f508 100644 --- a/docs/404.html +++ b/docs/404.html @@ -39,7 +39,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -82,24 +82,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/CODE_OF_CONDUCT.html b/docs/CODE_OF_CONDUCT.html index 11485cc..0747529 100644 --- a/docs/CODE_OF_CONDUCT.html +++ b/docs/CODE_OF_CONDUCT.html @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 4d9c014..c1dc6f0 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/articles/Intro-to-vosonSML.html b/docs/articles/Intro-to-vosonSML.html index 79f5758..4b82cfb 100644 --- a/docs/articles/Intro-to-vosonSML.html +++ b/docs/articles/Intro-to-vosonSML.html @@ -40,7 +40,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -83,24 +83,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • @@ -144,7 +144,7 @@

    VOSON Lab, Australian

    Robert Ackland, Bryan Gertzel, Francisca Borquez

    -

    15 August, 2022

    +

    16 August, 2022

    Source: vignettes/Intro-to-vosonSML.Rmd @@ -183,7 +183,6 @@

    15 August, 2022

    Twitter

    -

    Twitter data are collected via rtweet.

    Authenticating with the Twitter API

    @@ -313,7 +312,12 @@

    Importing Twitter Datartweet tweet data from dataframe or .RDS file using ImportRtweet():

    -twitterData <- ImportRtweet(readRDS("rtweet-tweets.rds"))
    +# from dataframe +tweets <- rtweet::search_tweets("#auspol", n = 100) +twitterData <- tweets |> ImportRtweet() + +# or from file +twitterData <- ImportRtweet("rtweet_search_n100.rds")

    diff --git a/docs/articles/index.html b/docs/articles/index.html index 265dbc7..5650197 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7
    @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/authors.html b/docs/authors.html index 6bdaaec..c507647 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • @@ -139,14 +139,14 @@

    Citation

    Gertzel B, Borquez F, Graham T, Ackland R (2022). vosonSML: Collecting Social Media Data and Generating Networks for Analysis. VOSON Lab, Virtual Observatory for the Study of Online Networks. -R package version 0.32.6, https://github.com/vosonlab/vosonSML. +R package version 0.32.7, https://github.com/vosonlab/vosonSML.

    @Manual{,
       title = {vosonSML: Collecting Social Media Data and Generating Networks for Analysis},
       author = {Bryan Gertzel and Francisca Borquez and Timothy Graham and Robert Ackland},
       organization = {VOSON Lab, Virtual Observatory for the Study of Online Networks},
       year = {2022},
    -  note = {R package version 0.32.6},
    +  note = {R package version 0.32.7},
       url = {https://github.com/vosonlab/vosonSML},
     }
    diff --git a/docs/extra.css b/docs/extra.css index 0e6bbc0..5efb755 100644 --- a/docs/extra.css +++ b/docs/extra.css @@ -1,3 +1,8 @@ +h5, .h5 { + font-size: 1.5rem; + font-weight: bold; +} + /* h1, .h1 { font-size: 2.8rem; diff --git a/docs/index.html b/docs/index.html index f07b350..d81929f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -20,7 +20,7 @@ @@ -31,7 +31,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -72,24 +72,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • @@ -140,7 +140,7 @@

    Twitter API authentication

    with their app. This token allows read-only access to the API but higher rate-limits so it is the most suited method for this package and data collection.

    The twitter OAuth process is described here: -https://developer.twitter.com/en/docs/basics/authentication/overview/oauth.

    +https://developer.twitter.com/en/docs/authentication/overview.

    diff --git a/docs/reference/Authenticate.web.html b/docs/reference/Authenticate.web.html index a501a49..5f51e34 100644 --- a/docs/reference/Authenticate.web.html +++ b/docs/reference/Authenticate.web.html @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7
    @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Authenticate.youtube.html b/docs/reference/Authenticate.youtube.html index 55c177b..6e7b2ad 100644 --- a/docs/reference/Authenticate.youtube.html +++ b/docs/reference/Authenticate.youtube.html @@ -18,7 +18,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -59,24 +59,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Collect.html b/docs/reference/Collect.html index 39b6fae..15e49bd 100644 --- a/docs/reference/Collect.html +++ b/docs/reference/Collect.html @@ -21,7 +21,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -62,24 +62,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Collect.reddit.html b/docs/reference/Collect.reddit.html index 93825e7..aee4a00 100644 --- a/docs/reference/Collect.reddit.html +++ b/docs/reference/Collect.reddit.html @@ -18,7 +18,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -59,24 +59,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Collect.search.twitter.html b/docs/reference/Collect.search.twitter.html index f8fb0a4..e038af1 100644 --- a/docs/reference/Collect.search.twitter.html +++ b/docs/reference/Collect.search.twitter.html @@ -30,7 +30,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -71,24 +71,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Collect.timeline.twitter.html b/docs/reference/Collect.timeline.twitter.html index 651038e..2eae994 100644 --- a/docs/reference/Collect.timeline.twitter.html +++ b/docs/reference/Collect.timeline.twitter.html @@ -19,7 +19,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -60,24 +60,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Collect.web.html b/docs/reference/Collect.web.html index 2354b3e..546d224 100644 --- a/docs/reference/Collect.web.html +++ b/docs/reference/Collect.web.html @@ -18,7 +18,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -59,24 +59,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Collect.youtube.html b/docs/reference/Collect.youtube.html index eee691a..27dd843 100644 --- a/docs/reference/Collect.youtube.html +++ b/docs/reference/Collect.youtube.html @@ -26,7 +26,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -67,24 +67,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Create.activity.reddit.html b/docs/reference/Create.activity.reddit.html index 8f0f7d5..dae51fb 100644 --- a/docs/reference/Create.activity.reddit.html +++ b/docs/reference/Create.activity.reddit.html @@ -18,7 +18,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -59,24 +59,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Create.activity.twitter.html b/docs/reference/Create.activity.twitter.html index 5f29e88..9f4b635 100644 --- a/docs/reference/Create.activity.twitter.html +++ b/docs/reference/Create.activity.twitter.html @@ -20,7 +20,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -61,24 +61,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Create.activity.web.html b/docs/reference/Create.activity.web.html index 24755d6..bd8947c 100644 --- a/docs/reference/Create.activity.web.html +++ b/docs/reference/Create.activity.web.html @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Create.activity.youtube.html b/docs/reference/Create.activity.youtube.html index 82d75a3..becb91e 100644 --- a/docs/reference/Create.activity.youtube.html +++ b/docs/reference/Create.activity.youtube.html @@ -18,7 +18,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -59,24 +59,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Create.actor.reddit.html b/docs/reference/Create.actor.reddit.html index 76c2ef0..9247895 100644 --- a/docs/reference/Create.actor.reddit.html +++ b/docs/reference/Create.actor.reddit.html @@ -18,7 +18,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -59,24 +59,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Create.actor.twitter.html b/docs/reference/Create.actor.twitter.html index e5ec23d..4dcf402 100644 --- a/docs/reference/Create.actor.twitter.html +++ b/docs/reference/Create.actor.twitter.html @@ -20,7 +20,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -61,24 +61,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Create.actor.web.html b/docs/reference/Create.actor.web.html index 46a7e8e..ff2ab86 100644 --- a/docs/reference/Create.actor.web.html +++ b/docs/reference/Create.actor.web.html @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Create.actor.youtube.html b/docs/reference/Create.actor.youtube.html index 2d0a7ab..c91c18e 100644 --- a/docs/reference/Create.actor.youtube.html +++ b/docs/reference/Create.actor.youtube.html @@ -20,7 +20,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -61,24 +61,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Create.html b/docs/reference/Create.html index e96644b..1a07622 100644 --- a/docs/reference/Create.html +++ b/docs/reference/Create.html @@ -27,7 +27,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -68,24 +68,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Create.semantic.twitter.html b/docs/reference/Create.semantic.twitter.html index 70eb556..887ca5f 100644 --- a/docs/reference/Create.semantic.twitter.html +++ b/docs/reference/Create.semantic.twitter.html @@ -22,7 +22,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -63,24 +63,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Create.twomode.twitter.html b/docs/reference/Create.twomode.twitter.html index ed3642a..c7e49dc 100644 --- a/docs/reference/Create.twomode.twitter.html +++ b/docs/reference/Create.twomode.twitter.html @@ -21,7 +21,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -62,24 +62,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Graph.html b/docs/reference/Graph.html index 7f6215e..01f73af 100644 --- a/docs/reference/Graph.html +++ b/docs/reference/Graph.html @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/ImportRtweet.html b/docs/reference/ImportRtweet.html index 428c784..f758055 100644 --- a/docs/reference/ImportRtweet.html +++ b/docs/reference/ImportRtweet.html @@ -20,7 +20,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -61,24 +61,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/Merge.html b/docs/reference/Merge.html index ac92634..18ac016 100644 --- a/docs/reference/Merge.html +++ b/docs/reference/Merge.html @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/MergeFiles.html b/docs/reference/MergeFiles.html index 0d556a6..307adfe 100644 --- a/docs/reference/MergeFiles.html +++ b/docs/reference/MergeFiles.html @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/auth_twitter_app.html b/docs/reference/auth_twitter_app.html index 54de5ef..a0afe5b 100644 --- a/docs/reference/auth_twitter_app.html +++ b/docs/reference/auth_twitter_app.html @@ -19,7 +19,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -60,24 +60,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/auth_twitter_dev.html b/docs/reference/auth_twitter_dev.html index 17feff8..1b4d1a9 100644 --- a/docs/reference/auth_twitter_dev.html +++ b/docs/reference/auth_twitter_dev.html @@ -21,7 +21,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -62,24 +62,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/auth_twitter_user.html b/docs/reference/auth_twitter_user.html index a65b234..8c24294 100644 --- a/docs/reference/auth_twitter_user.html +++ b/docs/reference/auth_twitter_user.html @@ -3,9 +3,7 @@ twitter API on their behalf. The implementation of this method in vosonSML does not require a developer account but does still require the user to have access to an apps two consumer API keys (generated by the app developer). The authentication object with token produced from this method allows the user to access the API within -their own user-context and rate-limits. -The twitter OAuth process is described here: -https://developer.twitter.com/en/docs/basics/authentication/overview/oauth."> @@ -23,7 +21,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -64,24 +62,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • @@ -123,8 +121,6 @@

    Twitter User API authentication

    account but does still require the user to have access to an apps two consumer API keys (generated by the app developer). The authentication object with token produced from this method allows the user to access the API within their own user-context and rate-limits.

    -

    The twitter OAuth process is described here: -https://developer.twitter.com/en/docs/basics/authentication/overview/oauth.

    diff --git a/docs/reference/index.html b/docs/reference/index.html index 15f78f0..e62c94b 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7
    @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • diff --git a/docs/reference/vosonSML-package.html b/docs/reference/vosonSML-package.html index e4fef54..06c2e2e 100644 --- a/docs/reference/vosonSML-package.html +++ b/docs/reference/vosonSML-package.html @@ -1,5 +1,5 @@ -vosonSML: Collecting Social Media Data and Generating Networks for Analysis — vosonSML-package • vosonSMLvosonSML: Collecting Social Media Data and Generating Networks for Analysis — vosonSML-package • vosonSML @@ -17,7 +17,7 @@ vosonSML - 0.32.6 + 0.32.7 @@ -58,24 +58,24 @@
  • - + - Testing the bot status of users in Twitter networks collected via vosonSML + Egocentric Networks from Twitter timelines
  • - + - Hyperlink Networks with vosonSML + Testing the bot status of users in Twitter networks collected via vosonSML
  • - + - Creating Twitter Networks with vosonSML using rtweet Data + Hyperlink Networks with vosonSML
  • @@ -112,7 +112,7 @@

    vosonSML: Collecting Social Media Data and Generating Networks for Analysis<
    -

    A suite of easy to use functions for collecting social media data and generating networks for analysis. Supports Twitter, Youtube, Reddit and web site data sources.

    +

    A suite of easy to use functions for collecting social media data and generating networks for analysis. Supports Twitter, YouTube, Reddit and web site data sources.

    diff --git a/man/Authenticate.twitter.Rd b/man/Authenticate.twitter.Rd index 0916f84..79e599b 100644 --- a/man/Authenticate.twitter.Rd +++ b/man/Authenticate.twitter.Rd @@ -57,7 +57,7 @@ with their app. This token allows read-only access to the API but higher rate-li method for this package and data collection. The twitter OAuth process is described here: -\url{https://developer.twitter.com/en/docs/basics/authentication/overview/oauth}. +\url{https://developer.twitter.com/en/docs/authentication/overview}. } \note{ \pkg{vosonSML} uses the \pkg{rtweet} package for twitter data collection and also gratefully acknowledges the diff --git a/man/auth_twitter_user.Rd b/man/auth_twitter_user.Rd index 5c2d25c..43373d7 100644 --- a/man/auth_twitter_user.Rd +++ b/man/auth_twitter_user.Rd @@ -25,9 +25,6 @@ twitter API on their behalf. The implementation of this method in \pkg{vosonSML} account but does still require the user to have access to an apps two consumer API keys (generated by the app developer). The authentication object with token produced from this method allows the user to access the API within their own user-context and rate-limits. - -The twitter OAuth process is described here: -\url{https://developer.twitter.com/en/docs/basics/authentication/overview/oauth}. } \note{ \pkg{vosonSML} uses the \pkg{rtweet} package for twitter data collection and also gratefully acknowledges the diff --git a/man/vosonSML-package.Rd b/man/vosonSML-package.Rd index 75c3631..2e9e8fd 100644 --- a/man/vosonSML-package.Rd +++ b/man/vosonSML-package.Rd @@ -7,7 +7,7 @@ \alias{vosonSML} \title{vosonSML: Collecting Social Media Data and Generating Networks for Analysis} \description{ -A suite of easy to use functions for collecting social media data and generating networks for analysis. Supports Twitter, Youtube, Reddit and web site data sources. +A suite of easy to use functions for collecting social media data and generating networks for analysis. Supports Twitter, YouTube, Reddit and web site data sources. } \seealso{ Useful links: diff --git a/pkgdown/extra.css b/pkgdown/extra.css index 0e6bbc0..5efb755 100644 --- a/pkgdown/extra.css +++ b/pkgdown/extra.css @@ -1,3 +1,8 @@ +h5, .h5 { + font-size: 1.5rem; + font-weight: bold; +} + /* h1, .h1 { font-size: 2.8rem; diff --git a/vignettes/Intro-to-vosonSML.R b/vignettes/Intro-to-vosonSML.R index 52c36f3..ffab589 100644 --- a/vignettes/Intro-to-vosonSML.R +++ b/vignettes/Intro-to-vosonSML.R @@ -2,22 +2,25 @@ # library(vosonSML) ## ----eval=FALSE--------------------------------------------------------------- -# twitterAuth <- -# Authenticate( -# "twitter", -# appName = "My App", -# apiKey = "xxxxxxxx", -# apiSecret = "xxxxxxxx", -# accessToken = "xxxxxxxx", -# accessTokenSecret = "xxxxxxxx") +# twitterAuth <- Authenticate("twitter", bearerToken = "xxxxxxxxxxxx") ## ----eval=FALSE--------------------------------------------------------------- -# twitterAuth <- -# Authenticate( -# "twitter", -# appName = "An App", -# apiKey = "xxxxxxxxxxxx", -# apiSecret = "xxxxxxxxxxxx") +# twitterAuth <- Authenticate( +# "twitter", +# appName = "My App", +# apiKey = "xxxxxxxx", +# apiSecret = "xxxxxxxx", +# accessToken = "xxxxxxxx", +# accessTokenSecret = "xxxxxxxx" +# ) + +## ----eval=FALSE--------------------------------------------------------------- +# twitterAuth <- Authenticate( +# "twitter", +# appName = "An App", +# apiKey = "xxxxxxxxxxxx", +# apiSecret = "xxxxxxxxxxxx" +# ) ## ----eval=FALSE--------------------------------------------------------------- # saveRDS(twitterAuth, file = "twitter_auth") @@ -27,15 +30,16 @@ ## ----eval=FALSE--------------------------------------------------------------- # twitterData <- twitterAuth |> -# Collect( -# searchTerm = "#auspol", -# numTweets = 1000, -# includeRetweets = FALSE, -# retryOnRateLimit = TRUE, -# writeToFile = TRUE) +# Collect( +# searchTerm = "#auspol", +# numTweets = 1000, +# includeRetweets = FALSE, +# writeToFile = TRUE, +# verbose = TRUE +# ) ## ----eval=FALSE--------------------------------------------------------------- -# > twitterData +# > twitterData$tweets # # A tibble: 999 x 90 # user_id status_id created_at screen_name text source # @@ -50,16 +54,10 @@ # twitterData <- readRDS("2020-09-26_095354-TwitterData.rds") ## ----eval=FALSE--------------------------------------------------------------- -# # use import data -# twitterData <- ImportData("2020-09-26_095354-TwitterData.rds", "twitter") +# actorNetwork <- twitterData |> +# Create("actor", writeToFile = TRUE, verbose = TRUE) # -# # or manually add class names to data -# twitterData <- readRDS("2020-09-26_095354-TwitterData.rds") -# class(twitterData) <- append(c("datasource", "twitter"), class(twitterData)) - -## ----eval=FALSE--------------------------------------------------------------- -# actorNetwork <- twitterData |> Create("actor", writeToFile = TRUE, verbose = TRUE) -# actorGraph <- actorNetwork |> Graph(writeToFile = TRUE) +# actorGraph <- actorNetwork |> Graph(writeToFile = TRUE, verbose = TRUE) ## ----eval=FALSE--------------------------------------------------------------- # > actorNetwork @@ -67,8 +65,8 @@ # # A tibble: 1,725 x 5 # from to edge_type timestamp status_id # -# 1 xxxxxxxx xxxxxxxx quote 2020-01-09 12:00… xxxxxxxxxxxxxxx… -# 2 xxxxxxxx xxxxxxxxx quote 2020-01-09 09:37… xxxxxxxxxxxxxxx… +# 1 xxxxxxxx xxxxxxxx quote 2020-01-09 12:00… xxxxxxxxxxxx… +# 2 xxxxxxxx xxxxxxxxx quote 2020-01-09 09:37… xxxxxxxxxxxx… # [snip] # # … with 1,715 more rows # @@ -111,12 +109,15 @@ # dev.off() ## ----eval=FALSE--------------------------------------------------------------- -# actorGraphWithText <- twitterData |> Create("actor") |> AddText(twitterData) |> Graph() +# actorGraphWithText <- twitterData |> +# Create("actor") |> AddText(twitterData) |> Graph() ## ----eval=FALSE--------------------------------------------------------------- # # get the index of nodes or users who tweeted the word "bushfire" -# ind <- tail_of(actorGraphWithText, -# grep("bushfire", tolower(E(actorGraphWithText)$vosonTxt_tweet))) +# ind <- tail_of( +# actorGraphWithText, +# grep("bushfire", tolower(E(actorGraphWithText)$vosonTxt_tweet)) +# ) # # # set node attribute # V(actorGraphWithText)$tweetedBushfires <- "no" @@ -124,7 +125,9 @@ ## ----eval=FALSE--------------------------------------------------------------- # # remove edges that are not reply edges -# g3 <- delete.edges(actorGraphWithText, which(E(actorGraphWithText)$edge_type != "reply")) +# g3 <- delete.edges( +# actorGraphWithText, which(E(actorGraphWithText)$edge_type != "reply") +# ) # # # get the giant component # cc <- clusters(g3) @@ -159,8 +162,8 @@ # # A tibble: 1,408 x 5 # status_id user_id screen_name created_at vosonTxt_tweet # -# 1 xxxxxxxxxxx… xxxxxxxx xxxx 2020-01-09 … "xxxxxxxxxxxxxxxxxxxxxxxxxx… -# 2 xxxxxxxxxxx… xxxxxxxx xxxxxxxxx 2020-01-09 … "xxxxxxxxxxxxxxxxxxxxxxxxxx… +# 1 xxxxxxxxxxx… xxxxxxxx xxxx 2020-01-09 … "xxxxxxxxxxxxxxxxxxxxx… +# 2 xxxxxxxxxxx… xxxxxxxx xxxxxxxxx 2020-01-09 … "xxxxxxxxxxxxxxxxxxxxx… # [snip] # # … with 1,398 more rows # @@ -190,8 +193,10 @@ ## ----eval=FALSE--------------------------------------------------------------- # # create a subgraph containing nodes of components that have more than 5 nodes # cc <- clusters(activityGraph) -# g4 <- induced_subgraph(activityGraph, -# which(cc$membership %in% which(cc$csize > 5))) +# g4 <- induced_subgraph( +# activityGraph, +# which(cc$membership %in% which(cc$csize > 5)) +# ) # # # set node colour based on if tweet contains the word "bushfire" # ind <- grep("bushfire", tolower(V(g4)$vosonTxt_tweet)) @@ -208,7 +213,8 @@ # install.packages("tidytext") # # # create a 2-mode network with the hashtag "#auspol" removed -# twomodeNetwork <- twitterData |> Create("twomode", removeTermsOrHashtags = c("#auspol")) +# twomodeNetwork <- twitterData |> +# Create("twomode", removeTermsOrHashtags = c("#auspol")) # twomodeGraph <- twomodeNetwork |> Graph() ## ----eval=FALSE--------------------------------------------------------------- @@ -228,8 +234,8 @@ # # A tibble: 1,675 x 5 # from to edge_type timestamp status_id # -# 1 xxxxxxxx #auspol2020 hashtag 2020-01-09 12:0… xxxxxxxxxxxxxxx… -# 2 xxxxxxxx #australianbushfiredis… hashtag 2020-01-09 12:0… xxxxxxxxxxxxxxx… +# 1 xxxxxxxx #auspol2020 hashtag 2020-01-09 12:0… xxxxxxxxxxxx… +# 2 xxxxxxxx #australianbushfiredis… hashtag 2020-01-09 12:0… xxxxxxxxxxxx… # [snip] # # … with 1,665 more rows # @@ -249,14 +255,15 @@ ## ----eval=FALSE--------------------------------------------------------------- # # get index of nodes that are in the top 5 by highest in-degree -# # this is the top 5 used hashtags, as all users have 0 in-degree in this network +# # this is the top 5 used hashtags, as all users have 0 in-degree +# # in this network # ind <- order(degree(twomodeGraph, mode = "in"), decreasing = TRUE)[1:5] # # # get index of nodes with an edge directed to the top 5 hashtags # # this is users who have tweeted with these hashtags -# ind2 <- unlist(lapply(ind, function(x) { -# neighbors(twomodeGraph, x, mode = "in") -# })) +# ind2 <- unlist( +# lapply(ind, function(x) neighbors(twomodeGraph, x, mode = "in")) +# ) # # # create a subgraph containing only the top 5 used hashtags and related users # g5 <- induced_subgraph(twomodeGraph, c(ind, as.numeric(ind2))) @@ -275,7 +282,7 @@ ## ----eval=FALSE--------------------------------------------------------------- # # additional required packages for tokenization and stopwords -# install.packages(c("tidyr", "tidytext", "stopwords")) +# install.packages(c("tidytext", "stopwords")) # # # create a semantic network with some common terms removed # # include only the top 5% occurring terms in the network @@ -359,43 +366,39 @@ # youtubeAuth <- Authenticate("youtube", apiKey = "xxxxxxxx") ## ----eval=FALSE--------------------------------------------------------------- -# videoIDs <- GetYoutubeVideoIDs(c("https://www.youtube.com/watch?v=xxxxxxxx", -# "https://youtu.be/xxxxxxxx")) +# videoIDs <- c( +# "xxxxxx", +# "https://www.youtube.com/watch?v=xxxxxxxx", +# "https://youtu.be/xxxxxxxx") +# ) ## ----eval=FALSE--------------------------------------------------------------- -# videoIDs <- GetYoutubeVideoIDs("https://www.youtube.com/watch?v=pJ_NyEYRkLQ") -# youtubeData <- youtubeAuth |> Collect(videoIDs, maxComments = 500, writeToFile = TRUE) +# videoID <- "https://www.youtube.com/watch?v=pJ_NyEYRkLQ" +# youtubeData <- youtubeAuth |> +# Collect(videoID, maxComments = 500, writeToFile = TRUE) ## ----eval=FALSE--------------------------------------------------------------- # > str(youtubeData) # Classes ‘dataource’, ‘youtube’ and 'data.frame': 603 obs. of 12 variables: -# $ Comment : chr "xxxxx" ... -# $ AuthorDisplayName : chr "xx" "xx" "xx" "xx" ... -# $ AuthorProfileImageUrl: chr "https://xx" "https://xx" "https://xx" "https://xx" ... -# $ AuthorChannelUrl : chr "http://xx" "http://xx" "http://xx" "http://xx" ... -# $ AuthorChannelID : chr "xx" "xx" "xx" "xx" ... -# $ ReplyCount : chr "0" "0" "0" "0" ... -# $ LikeCount : chr "0" "0" "0" "0" ... -# $ PublishedAt : chr "2020-01-10T02:23:43.000Z" "2020-01-09T20:56:23.000Z" -# "2020-01-09T20:44:00.000Z" "2020-01-09T19:31:32.000Z" ... -# $ UpdatedAt : chr "2020-01-10T02:23:43.000Z" "2020-01-09T20:56:23.000Z" -# "2020-01-09T20:44:00.000Z" "2020-01-09T19:31:32.000Z" ... -# $ CommentID : chr "xx" "xx" "xx" "xx" ... -# $ ParentID : chr NA NA NA NA ... -# $ VideoID : chr "pJ_NyEYRkLQ" "pJ_NyEYRkLQ" "pJ_NyEYRkLQ" "pJ_NyEYRkLQ" ... +# $ Comment : chr "xxxxx" +# $ AuthorDisplayName : chr "xx" "xx" "xx" "xx" +# $ AuthorProfileImageUrl: chr "https://xx" "https://xx" "https://xx" +# $ AuthorChannelUrl : chr "http://xx" "http://xx" "http://xx" "http://xx" +# $ AuthorChannelID : chr "xx" "xx" "xx" "xx" +# $ ReplyCount : chr "0" "0" "0" "0" +# $ LikeCount : chr "0" "0" "0" "0" +# $ PublishedAt : chr "2020-01-10T02:23:43" "2020-01-09T20:56:23" +# "2020-01-09T20:44:00" "2020-01-09T19:31:32" +# $ UpdatedAt : chr "2020-01-10T02:23:43" "2020-01-09T20:56:23" +# "2020-01-09T20:44:00" "2020-01-09T19:31:32" +# $ CommentID : chr "xx" "xx" "xx" "xx" +# $ ParentID : chr NA NA NA NA +# $ VideoID : chr "pJ_NyLQ" "pJ_NyLQ" "pJ_NyLQ" "pJ_NyLQ" ## ----eval=FALSE--------------------------------------------------------------- # # read dataframe from file # youtubeData <- readRDS("2020-09-26_095354-YoutubeData.rds") -## ----eval=FALSE--------------------------------------------------------------- -# # use import data -# youtubeData <- ImportData("2020-09-26_095354-YoutubeData.rds", "youtube") -# -# # or manually add class names to data -# youtubeData <- readRDS("2020-09-26_095354-YoutubeData.rds") -# class(twitterData) <- append(c("datasource", "youtube"), class(youtubeData)) - ## ----eval=FALSE--------------------------------------------------------------- # actorNetwork <- youtubeData |> Create("actor") |> AddText(youtubeData) # actorGraph <- actorNetwork |> Graph(writeToFile = TRUE) @@ -445,7 +448,9 @@ ## ----eval=FALSE--------------------------------------------------------------- # # change color of nodes with type video to red and others grey -# V(actorGraph)$color <- ifelse(V(actorGraph)$node_type == "video", "red", "grey") +# V(actorGraph)$color <- ifelse( +# V(actorGraph)$node_type == "video", "red", "grey" +# ) # # # open and write plot to a png file # png("youtube_actor.png", width = 600, height = 600) @@ -454,7 +459,9 @@ ## ----eval=FALSE--------------------------------------------------------------- # # removed edges that are not of type reply-comment -# g2 <- delete.edges(actorGraph, which(E(actorGraph)$edge_type != "reply-comment")) +# g2 <- delete.edges( +# actorGraph, which(E(actorGraph)$edge_type != "reply-comment") +# ) # # # check number of isolates # > length(which(degree(g2) == 0)) @@ -463,10 +470,13 @@ # # remove isolates # g2 <- delete.vertices(g2, which(degree(g2) == 0)) # -# # get node indexes for the tails of edges that have comments containing words of interest -# # change the indexed node colors to red and others grey +# # get node indexes for the tails of edges that have comments containing +# # words of interest change the indexed node colors to red and others grey # V(g2)$color <- "grey" -# ind <- tail_of(actorGraph, grep("arson|backburn|climate change", tolower(E(g2)$vosonTxt_comment))) +# ind <- tail_of( +# actorGraph, +# grep("arson|backburn|climate change", tolower(E(g2)$vosonTxt_comment)) +# ) # V(g2)$color[ind] <- "red" # # # open and write plot to a png file @@ -500,8 +510,8 @@ # # $videos # # A tibble: 1 x 6 -# VideoID VideoTitle VideoDescription VideoPublishedAt ChannelID ChannelTitle -# +# VideoID VideoTitle VideoDescription VideoPublishedAt ChannelID ChannelTitle +# # 1 pJ_NyEY… Australia … "As Australia ba… 2020-01-05T12:3… UCknLrEd… DW News # # attr(,"class") @@ -556,7 +566,9 @@ # # # get node indexes of comments that contain terms of interest # # set their node colors to blue -# ind <- grep("arson|backburn|climate change", tolower(V(activityGraph)$vosonTxt_comment)) +# ind <- grep( +# "arson|backburn|climate change", tolower(V(activityGraph)$vosonTxt_comment) +# ) # V(activityGraph)$color[ind] <- "blue" # # # open and write plot to a png file @@ -565,28 +577,31 @@ # dev.off() ## ----eval=FALSE--------------------------------------------------------------- -# myThreadUrls <- c("https://www.reddit.com/r/xxxxxx/comments/xxxxxx/x_xxxx_xxxxxxxxx/", -# "https://www.reddit.com/r/xxxxxx/comments/xxxxxx/x_xxxx_xxxxxxxxx/") +# myThreadUrls <- c( +# "https://www.reddit.com/r/xxxxxx/comments/xxxxxx/x_xxxx_xxxxxxxxx/", +# "https://www.reddit.com/r/xxxxxx/comments/xxxxxx/x_xxxx_xxxxxxxxx/" +# ) ## ----eval=FALSE--------------------------------------------------------------- -# myThreadUrls <- c("https://www.reddit.com/r/worldnews/comments/elcb9b/australias_leaders_deny_link_between_climate/") +# myThreadUrls <- "https://www.reddit.com/r/worldnews/comments/elcb9b/australias_leaders_deny_link_between_climate/" # redditData <- Authenticate("reddit") |> # Collect(threadUrls = myThreadUrls, writeToFile = TRUE) ## ----eval=FALSE--------------------------------------------------------------- # > str(redditData) -# Classes ‘tbl_df’, ‘tbl’, ‘datasource’, ‘reddit’ and 'data.frame': 767 obs. of 22 variables: +# Classes ‘tbl_df’, ‘tbl’, ‘datasource’, ‘reddit’ and 'data.frame': +# 767 obs. of 22 variables: # $ id : int 1 2 3 4 5 6 7 8 9 10 ... -# $ structure : chr "1" "4_1_1_1_1_1_1_1_1_1" "4_1_1_4_2_1_1_1_1_1" "4_1_1_4_3_1_1_1_3_1" ... -# $ post_date : chr "2020-01-07 14:34:58" "2020-01-07 14:34:58" "2020-01-07 14:34:58" "2020-01-07 14:34:58" ... +# $ structure : chr "1" "4_1_1_1_1_1_1_1_1_1" "4_1_1_4_2_1_1_1_1_1" ... +# $ post_date : chr "2020-01-07 14:34:58" "2020-01-07 14:34:58" ... # $ post_date_unix : num 1.58e+09 1.58e+09 1.58e+09 1.58e+09 1.58e+09 ... # $ comm_id : chr "xxxx" "xxxx" "xxxx" "xxxx" ... -# $ comm_date : chr "2020-01-07 19:11:10" "2020-01-07 21:04:05" "2020-01-07 20:15:49" "2020-01-07 21:24:01" ... +# $ comm_date : chr "2020-01-07 19:11:10" "2020-01-07 21:04:05" ... # $ comm_date_unix : num 1.58e+09 1.58e+09 1.58e+09 1.58e+09 1.58e+09 ... # $ num_comments : int 4435 4435 4435 4435 4435 4435 4435 4435 4435 4435 ... # $ subreddit : chr "worldnews" "worldnews" "worldnews" "worldnews" ... # $ upvote_prop : num 0.91 0.91 0.91 0.91 0.91 0.91 0.91 0.91 0.91 0.91 ... -# $ post_score : int 45714 45714 45714 45712 45714 45710 45720 45712 45708 45711 ... +# $ post_score : int 45714 45714 45714 45712 45714 45710 45720 45712 .. # $ author : chr "xxxx" "xxxx" "xxxx" "xxxx" ... # $ user : chr "xxxx" "xxxx" "xxxx" "xxxx" ... # $ comment_score : int 1904 136 17 13 9 9 125 4 6 12 ... @@ -602,14 +617,6 @@ ## ----eval=FALSE--------------------------------------------------------------- # redditData <- readRDS("2020-09-26_095354-RedditData.rds") -## ----eval=FALSE--------------------------------------------------------------- -# # use import data -# redditData <- ImportData("2020-09-26_095354-RedditData.rds", "reddit") -# -# # or manually add class names to data -# redditData <- readRDS("2020-09-26_095354-RedditData.rds") -# class(redditData) <- append(c("datasource", "reddit"), class(redditData)) - ## ----eval=FALSE--------------------------------------------------------------- # actorNetwork <- redditData |> Create("actor") |> AddText(redditData) # actorGraph <- actorNetwork |> Graph(writeToFile = TRUE) @@ -627,10 +634,10 @@ # # $edges # # A tibble: 768 x 8 -# from to subreddit thread_id comment_id comm_id vosonTxt_comment title -# -# 1 1 439 worldnews elcb9b 1 xxxxxxx "xxxxxxxxxxxxxxxxxxx NA -# 2 2 73 worldnews elcb9b 2 xxxxxxx "xxxxxxxxxxxxxxxxxxx NA +# from to subreddit thread_id comment_id comm_id vosonTxt_comment title +# +# 1 1 439 worldnews elcb9b 1 xxxxxxx "xxxxxxxxxxxxxxxxxxx NA +# 2 2 73 worldnews elcb9b 2 xxxxxxx "xxxxxxxxxxxxxxxxxxx NA # [snip] # … with 758 more rows # @@ -653,14 +660,20 @@ # + ... omitted several edges ## ----eval=FALSE--------------------------------------------------------------- -# # set node color of original post to red based on presence of title edge attribute -# # set other node colors to grey +# # set node color of original post to red based on presence of title edge +# # attribute set other node colors to grey # V(actorGraph)$color <- "grey" -# V(actorGraph)$color[tail_of(actorGraph, which(!is.na(E(actorGraph)$title)))] <- "red" -# -# # get node indexes for the tails of edges that have comments containing words of interest -# # set their node colors to blue -# ind <- tail_of(actorGraph, grep("arson|starting fires", tolower(E(actorGraph)$vosonTxt_comment))) +# V(actorGraph)$color[tail_of( +# actorGraph, which(!is.na(E(actorGraph)$title)) +# )] <- "red" +# +# # get node indexes for the tails of edges that have comments containing +# # words of interest set their node colors to blue +# ind <- tail_of( +# actorGraph, +# grep("arson|starting fires", +# tolower(E(actorGraph)$vosonTxt_comment)) +# ) # V(actorGraph)$color[ind] <- "blue" # # # open and write plot to a png file @@ -737,50 +750,13 @@ # bushfireTwitterData <- twitterAuth |> # Collect(searchTerm = "#bushfire", searchType = "popular", numTweets = 50) # -# # combine the collected data for the different hashtags using rbind -# twitterData <- rbind(auspolTwitterData, bushfireTwitterData) - -## ----eval=FALSE--------------------------------------------------------------- -# # collect twitter data -# newTwitterData <- twitterAuth |> -# Collect(searchTerm = "#auspol", searchType = "recent", numTweets = 100) -# -# # import data from file using ImportData -# prevTwitterData <- ImportData("2020-02-26_143505-TwitterData.rds", "twitter") -# -# # add to imported data the new data using rbind -# twitterData <- rbind(prevTwitterData, newTwitterData) - -## ----eval=FALSE--------------------------------------------------------------- -# # vector of file names matching *TwitterData.rds to combine from directory -# importFiles <- list.files(path = "D:\\2019TwitterBushfireData", -# pattern = "*TwitterData.rds", -# full.names = TRUE) -# -# # combine imported data from files with apply and rbind -# twitterData <- do.call("rbind", lapply(importFiles, function(x) { ImportData(x, "twitter") })) +# # combine the collected data for the different hashtags +# twitterData <- Merge(auspolTwitterData, bushfireTwitterData, writeToFile = TRUE) ## ----eval=FALSE--------------------------------------------------------------- -# # load dplyr -# library(dplyr) -# -# # combine the collected data using rbind and remove duplicates with distinct based on tweet status_id -# twitterData <- rbind(auspolTwitterData, bushfireTwitterData) |> distinct(status_id, .keep_all = TRUE) - -## ----eval=FALSE--------------------------------------------------------------- -# # manually combine data sets in reverse chronological order and remove duplicates based on status_id -# twitterData <- rbind(bushfireTwitterData, auspolTwitterData) |> -# distinct(status_id, .keep_all = TRUE) -# -# # arrange combined youtube data by updated timestamp and remove duplicates, keeping the version of a -# # duplicate video comment that was most recently updated -# youtubeData <- youtubeData |> -# arrange(desc(UpdatedAt)) |> distinct(VideoID, CommentID, .keep_all = TRUE) -# -# # arrange combined reddit data by comment timestamp and remove duplicates, keeping the version of a -# # duplicate thread comment that was most recently updated -# redditData <- redditData |> -# arrange(desc(comm_date_unix)) |> distinct(thread_id, comm_id, .keep_all = TRUE) +# twitterData <- MergeFiles( +# "2019TwitterBushfireData", pattern = "*TwitterData.rds" +# ) ## ----eval=FALSE--------------------------------------------------------------- # # create an igraph of twitter actor network diff --git a/vignettes/Intro-to-vosonSML.Rmd b/vignettes/Intro-to-vosonSML.Rmd index a28401d..61f661f 100644 --- a/vignettes/Intro-to-vosonSML.Rmd +++ b/vignettes/Intro-to-vosonSML.Rmd @@ -42,8 +42,6 @@ There are three steps involved in data collection and network creation using `vo # Twitter -Twitter data are collected via [rtweet](https://cran.r-project.org/package=rtweet). - ## Authenticating with the Twitter API The first step is to authorise access to the Twitter API. This requires completion of an application and approval for @@ -166,8 +164,13 @@ twitterData <- readRDS("2020-09-26_095354-TwitterData.rds") As `vosonSML` uses `rtweet` for data collection you can also import `rtweet` tweet data from dataframe or `.RDS` file using `ImportRtweet()`: -```{r eval=FALSE} -twitterData <- ImportRtweet(readRDS("rtweet-tweets.rds")) +``` r +# from dataframe +tweets <- rtweet::search_tweets("#auspol", n = 100) +twitterData <- tweets |> ImportRtweet() + +# or from file +twitterData <- ImportRtweet("rtweet_search_n100.rds") ``` ## Creating Twitter Networks