Learn R Programming

PolitwoopsR (version 1.0)

get_pw_tweets: Get deleted politician tweet data from the Politwoops project

Description

This function downloads and combines json files from any of the countries participating in the Politwoops project (defaults to the US).

Usage

get_pw_tweets(start.page = 1, end.page = "all", domain = NULL, json.ext = NULL)

Arguments

start.page
The first json page to get - defaults to page 1.
end.page
The last json page to get - defaults to the last available page.
domain
The domain for the politwoops project of interest (do not include "http://"). Defaults to the US domain (politwoops.sunlightfoundation.com). For a list of other countries, see http://politwoops.com/countries.
json.ext
The last part of the URL that points to the country JSON pages - defaults to "/index.json?page=" which seems to be correct for some countris (including the US and UK) but not others. Future versions of this package will automate identifying this extension.

Value

Data frame with deleted tweet information from Politwoops.

See Also

get_pw_pol merge_pw

Examples

Run this code
## Not run: 
# 
# # Get all the US Politwoops tweets:
# tweet.df <- get_pw_tweets()
# 
# # Get the first 5 pages from the UK Politwoops tweets:
# tweet.df <- get_pw_tweets(1, 5, "politwoops.co.uk")
# 
# # Get the first 5 pages from Argentina's Politwoops tweets:
# tweet.df <- get_pw_tweets(1, 5, "www.politwoops.com/g/Argentina", ".json?page=")
# 
# ## End(Not run)

Run the code above in your browser using DataLab