简体   繁体   中英

Search_tweets() (rtweet package) does not return all expected columns

I'm using the rtweet package and it's not returning the database with all columns with the search_tweets() function. The database has only 35 columns and no columns "screen_name" and "mentions_screen_name". Please how to get the rest of the columns? Below an example the columns returned.

tweets.df <- search_tweets("science")

names(tweets.df)

 [1] "created_at"                    "id"                           
 [3] "id_str"                        "full_text"                    
 [5] "truncated"                     "display_text_range"           
 [7] "entities"                      "metadata"                     
 [9] "source"                        "in_reply_to_status_id"        
[11] "in_reply_to_status_id_str"     "in_reply_to_user_id"          
[13] "in_reply_to_user_id_str"       "in_reply_to_screen_name"      
[15] "geo"                           "coordinates"                  
[17] "place"                         "contributors"                 
[19] "is_quote_status"               "retweet_count"                
[21] "favorite_count"                "favorited"                    
[23] "retweeted"                     "possibly_sensitive"           
[25] "lang"                          "retweeted_status"             
[27] "quoted_status_id"              "quoted_status_id_str"         
[29] "quoted_status"                 "text"                         
[31] "favorited_by"                  "display_text_width"           
[33] "quoted_status_permalink"       "query"                        
[35] "possibly_sensitive_appealable"

You seem to have installed the development version of rtweet 0.7.0 < rtweet > 1.0.0 which is not released yet on CRAN. Could you post the packageVersion("rtweet") output?

The devel version of rtweet returns only the columns returned by the API but the user information is retrieval via users_data(tweets.df) . There you will find the id and screen name of the user who posted the tweets. The previous mentions_screen_name is the in_reply_to_screen_name column. Please make sure that you read the documentation of the version you are using

This is the version

packageVersion("rtweet") [1] '0.7.0'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM