👽 R project for the collection and creation of Reddit conversation thread networks. Uses the PRAW Python module to access and collect data from the Reddit API via the R reticulate package.
Note
This project is in an initial exploratory phase and does not yet have an interface or package. Future versions will see it formalised into an R package with expanded capabilities.
Perform the following steps after installing Python and R reticulate.
- A python environment named
.venv
is required in the R project directory. Create the environment and install the required modules.
# create environment
$ python -m pip install --upgrade pip
$ python -m venv ./.venv/
# activate environment
$ source ./.venv/Scripts/activate
# install required python modules
(.venv) $ pip install -r requirements.txt --upgrade
# finish
(.venv) $ deactivate
- Add Reddit API keys to
.env
file in the R project directory.
REDDIT_CLIENT_ID=xxxxxxxxxxx
REDDIT_CLIENT_SECRET=xxxxxxxxxxxxx
REDDIT_CLIENT_UA="my alien reddit script"
NON_INTERACTIVE_FILE=false
- Edit and use the
get_thread.R
script. Uses raw URL's for Reddit threads specified by the following variableurl <- "https://www.reddit.com/r/xxxxxx/comments/xxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx/"
.