academictwitteR icon indicating copy to clipboard operation
academictwitteR copied to clipboard

[FR] Adding tweet type

Open msaeltzer opened this issue 3 years ago • 1 comments

Describe the solution you'd like

Adding columns if the tweet is a reply, retweet or quoted tweet. At the moment bind_tweets only contains retweet counts etc.

Anything else?

I wrote some helper functions that do this, could do a pull request.

msaeltzer avatar Dec 08 '21 16:12 msaeltzer

@msaeltzer You know this right?

require(academictwitteR)
#> Loading required package: academictwitteR
res <- bind_tweets(system.file("extdata", "tweetdata", package = "academictwitteR"), output_format = "tidy")
res$in_reply_to_user_id
#>  [1] NA                    NA                    NA                   
#>  [4] NA                    NA                    NA                   
#>  [7] NA                    NA                    NA                   
#> [10] NA                    NA                    "1238776140094996481"
#> [13] "970421608362934272"  "2316172198"          NA                   
#> [16] NA                    NA                    "771444093809467397" 
#> [19] NA                    NA                    NA                   
#> [22] NA                    "47919307"            "47919307"           
#> [25] NA
res$sourcetweet_type
#>  [1] "retweeted" "retweeted" "retweeted" "retweeted" "retweeted" NA         
#>  [7] NA          NA          NA          NA          NA          NA         
#> [13] NA          NA          NA          NA          NA          NA         
#> [19] NA          NA          NA          NA          NA          NA         
#> [25] "quoted"

Created on 2021-12-08 by the reprex package (v2.0.1)

chainsawriot avatar Dec 08 '21 20:12 chainsawriot