knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of einfach is to make collecting tweets through the Academic Research Product Track V2 API as simple as possible. This package is inspired by Facepager (Jünger & Keyling, 2019). But the author of this package doesn't have the talent to clone it accurately, and thus einfach is not Facepager's accurate clone, honestly.
You can install the development version of einfach from Github with:
devtools::install_github("chainsawriot/einfach")
You need to have access to the Academic Research Product Track V2 API. Please refer to the academictwitteR's vignette for more information.
Please setup your bearer token according to the instructions in ?get_bearer()
.
You can do that either by inserting this line in either your .Renviron
(You can edit your .Renviron
using usethis::edit_r_environ()
.)
TWITTER_BEARER="BABABABABABA"
Advance users might know that you can also insert this line in your ~/*rc
(e.g. ~/.bashrc
or ~/.zshrc
) to get the same result.
export TWITTER_BEARER="BABABABABABABA"
require(einfach) einfach()
If you want to know how to build a query, please read this guide from Twitter.
You can dump the collected data as either Serialized R Object (RDS), Comma-seperated data (CSV), Excel (xlsx), Stata (dta) or SPSS (sav).
The format is the so-called "tidy" format like the one below
example <- readRDS(system.file("extdata", "example_data.RDS", package = "einfach"))
require(tibble)
example
With the following columns
colnames(example)
Contributions in the form of feedback, comments, code, and bug report are welcome.
Please note that the einfach project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.