Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #41 from bretsw/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
bretsw authored Nov 19, 2021
2 parents a5c6689 + 98867af commit 1cb2666
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 34 deletions.
16 changes: 16 additions & 0 deletions CITATION
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@Manual{R-base,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2021},
url = {https://www.R-project.org/},
}

@Manual{R-tidytags,
title = {tidytags: Importing and Analyzing Twitter Data Collected with Twitter Archiving Google Sheets},
author = {K. Bret {Staudt Willet} and Joshua M. Rosenberg},
note = {https://bretsw.github.io/tidytags/},
year = {2021},
}

8 changes: 5 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ Soon, you will be able to install the released version of {tidytags} from [CRAN]
install.packages("tidytags")
```

## Usage

To load {tidytags}, start with the `library()` function:

```{r}
Expand All @@ -69,6 +67,10 @@ For help with initial {tidytags} setup, see the [Getting started with tidytags](
3. Getting and storing Twitter API tokens
4. Getting and storing an OpenCage Geocoding API key

## Usage

To test the {tidytags} package, you can use an openly shared TAGS tracker that has been collecting tweets associated with the AECT 2019 since September 30, 2019. This is the same TAGS tracker used in the [Using tidytags with a conference hashtag vignette](https://bretsw.github.io/tidytags/articles/tidytags-with-conf-hashtags.html).

## {tidytags} core functions

### read_tags()
Expand Down Expand Up @@ -105,7 +107,7 @@ If you would like to become a more involved contributor, please read the [Contri

You can cite this package like this: "we collected, processed, and analyzed Twitter data using the tidytags R package (Staudt Willet & Rosenberg, 2021)". Here is the full bibliographic reference to include in your reference list:

`r citation("tidytags")`
> Staudt Willet, K. B., & Rosenberg, J. M. (2021). tidytags: Importing and analyzing Twitter data collected with Twitter Archiving Google Sheets. https://github.com/bretsw/tidytags (R package version 0.2.0)
## License [![license](https://img.shields.io/badge/license-GPL3-9cf.svg)](https://www.gnu.org/licenses/gpl.html)

Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ from [CRAN](https://CRAN.R-project.org) with:
install.packages("tidytags")
```

## Usage

To load {tidytags}, start with the `library()` function:

``` r
Expand All @@ -69,6 +67,14 @@ vignette. Specifically, this guide offers help for four key tasks:
3. Getting and storing Twitter API tokens
4. Getting and storing an OpenCage Geocoding API key

## Usage

To test the {tidytags} package, you can use an openly shared TAGS
tracker that has been collecting tweets associated with the AECT 2019
since September 30, 2019. This is the same TAGS tracker used in the
[Using tidytags with a conference hashtag
vignette](https://bretsw.github.io/tidytags/articles/tidytags-with-conf-hashtags.html).

## {tidytags} core functions

### read\_tags()
Expand Down Expand Up @@ -185,13 +191,9 @@ analyzed Twitter data using the tidytags R package (Staudt Willet &
Rosenberg, 2021)”. Here is the full bibliographic reference to include
in your reference list:

list(title = “tidytags: Importing and Analyzing Twitter Data Collected
with TwitterGoogle Sheets”, author = list(list(given = “K. Bret”, family
= “Staudt Willet”, role = c(“aut”, “cre”), email = “<[email protected]>”,
comment = c(ORCID = “0000-0002-6984-416X”)), list(given = “Joshua M.”,
family = “Rosenberg”, role = “aut”, email = NULL, comment = c(ORCID =
“0000-0003-2170-0447”))), year = “2021”, note =
“<a href="https://bretsw.github.io/tidytags/,\nhttps://github.com/bretsw/tidytags" class="uri">https://bretsw.github.io/tidytags/,\nhttps://github.com/bretsw/tidytags</a>”)
> Staudt Willet, K. B., & Rosenberg, J. M. (2021). tidytags: Importing
> and analyzing Twitter data collected with Twitter Archiving Google
> Sheets. <https://github.com/bretsw/tidytags> (R package version 0.2.0)
## License [![license](https://img.shields.io/badge/license-GPL3-9cf.svg)](https://www.gnu.org/licenses/gpl.html)

Expand Down
8 changes: 4 additions & 4 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ reference:
contents:
- create_edgelist
- add_users_data
- get_mentions
- get_quotes
- get_replies
- get_retweets
- create_mentions_edgelist
- create_quotes_edgelist
- create_replies_edgelist
- create_retweets_edgelist
- title: "Processing data"
desc: Functions related to processing data for subsequent analysis.
contents:
Expand Down
13 changes: 8 additions & 5 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ pkgdown_sha: ~
articles:
setup: setup.html
tidytags-with-conf-hashtags: tidytags-with-conf-hashtags.html
last_built: 2021-11-19T15:27Z
last_built: 2021-11-19T16:59Z

Binary file modified docs/reference/figures/tidytags-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions docs/reference/pull_tweet_data.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified man/figures/tidytags-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions man/pull_tweet_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified tidytags-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions vignettes/tidytags-with-conf-hashtags.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ vignette: >
---

```{r setup, include=FALSE}
# Use the following command to recompute the vignette as needed.
# See https://ropensci.org/blog/2019/12/08/precompute-vignettes/ for help.
# knitr::knit("vignettes/tidytags-with-conf-hashtags.Rmd.orig", output = "vignettes/tidytags-with-conf-hashtags.Rmd")


knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
Expand All @@ -18,11 +23,6 @@ knitr::opts_chunk$set(
message = FALSE,
warning = FALSE,
error = FALSE)

# Use the following command to recompute the vignette as needed.
# See https://ropensci.org/blog/2019/12/08/precompute-vignettes/ for help.
# knitr::knit("vignettes/tidytags-with-conf-hashtags.Rmd.orig", output = "vignettes/tidytags-with-conf-hashtags.Rmd")

```

```{r}
Expand Down Expand Up @@ -72,7 +72,7 @@ example_df_all <- readr::read_csv("my-downloaded-tags-file.csv")

With a TAGS archive imported into R, {tidytags} allows you to gather quite a bit more information related to the collected tweets with the `pull_tweet_data()` function. This function uses the [{rtweet} package](https://rtweet.info/) (via `rtweet::lookup_statuses()`) to query the Twitter API. Using {rtweet} requires Twitter API keys associated with an approved developer account. Fortunately, the {rtweet} vignette, [Obtaining and using access tokens](https://rtweet.info/articles/auth.html), provides a very thorough guide to obtaining Twitter API keys. For further help getting your own Twitter API keys, see the [Getting started with tidytags](https://bretsw.github.io/tidytags/articles/setup.html) vignette we've written, specifically **Pain Point #2**.

Note that your dataset will often contain fewer rows after running `pull_tweet_data()`. This is because `rtweet::lookup_statuses()` is searching for tweet IDs that are currently available. Any tweets that have been deleted or made "protected" (i.e., private) since TAGS first collected them are dropped from the dataset. Rather than view this as a limitation, we see this as an asset to help ensure our data better reflects the intentions of the accounts whose tweets we have collected (see Fiesler & Proferes, 2018).
Note that your dataset will often contain fewer rows after running `pull_tweet_data()`. This is because `rtweet::lookup_statuses()` is searching for tweet IDs that are currently available. Any tweets that have been deleted or made "protected" (i.e., private) since TAGS first collected them are dropped from the dataset. Rather than view this as a limitation, we see this as an asset to help ensure our data better reflects the intentions of the accounts whose tweets we have collected (see [Fiesler & Proferes, 2018](https://journals.sagepub.com/doi/full/10.1177/2056305118763366)).

Here, we demonstrate two different ways of using `pull_tweet_data()`. The first method is to query the Twitter API with the tweet ID numbers from the `id_str` column returned by {rtweet}. However, a limitation of TAGS is that the numbers in this column are often corrupted because Google Sheets considers them very large numbers (instead of character strings) and rounds them by putting them into exponential form. The results of this first method are stored in the variable `example_after_rtweet_A` below. The second method pulls the tweet ID numbers from the tweet URLs. For example, the tweet with the URL `https://twitter.com/tweet__example/status/1176592704647716864` has a tweet ID of `1176592704647716864`. The results of this second method are stored in the variable `example_after_rtweet_B` below.

Expand Down

0 comments on commit 1cb2666

Please sign in to comment.