From 433968d29df0491f01be1ac8bb286de781dcdf24 Mon Sep 17 00:00:00 2001 From: chainsawriot Date: Sun, 12 Dec 2021 12:37:39 +0100 Subject: [PATCH] Fix the footnotes with non-numerical references --- 02-Best_practices.Rmd | 8 ++++---- 14-Twitter_API.Rmd | 10 +++++----- references_overall.bib | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/02-Best_practices.Rmd b/02-Best_practices.Rmd index 53eefe7..b117e28 100644 --- a/02-Best_practices.Rmd +++ b/02-Best_practices.Rmd @@ -43,7 +43,7 @@ For a quick experimentation, run this: usethis::edit_r_environ(scope = "user") ``` -If you are doing this in RStudio, a new file is now opened. That is your user-level `.Renviron` file. It is a hidden file (indicated by the ".") in your user directory [^1]. +If you are doing this in RStudio, a new file is now opened. That is your user-level `.Renviron` file. It is a hidden file (indicated by the ".") in your user directory [^unix]. For most people, it should be a blank file. For some, the file might already have something in it. Now, in the file, put this line into it: @@ -76,7 +76,7 @@ yt_oauth(app_id = Sys.getenv("YT_CLIENTID"), token = '') ``` -As long as your hidden `.Renviron` file is not leaked, you are safe. For reproducibility purposes, you should document all these envvars (the definitions, not the values) in the README file [^2]. +As long as your hidden `.Renviron` file is not leaked, you are safe. For reproducibility purposes, you should document all these envvars (the definitions, not the values) in the README file [^gha]. This method is not perfect, of course. For example, your `.Renviron` is a plain text file and it can still be leaked. If you want to know other alternatives, see the ["Managing secrets" vignette](https://httr.r-lib.org/articles/secrets.html) of httr. @@ -123,6 +123,6 @@ forget(mGET) For more information about memoisation, please refer to the [official website of memoise](https://memoise.r-lib.org/index.html). -[^1]: For the Unix users (Mac OSX, Linux, FreeBSD, Solaris, HPUX, etc.) reading this, you can also define envvars in your hidden `.*rc` file (e.g. `.bashrc` or `.zshrc`, depending on your shell). The method is to set that up using `export YT_CLIENTSECRET="MbOSt6cQhhFkwETXKur-L9rN"`. The envvars defined in your `.*rc` file can also be retrieved by `Sys.getenv`. The section on [Google Natural Language API](#google-natural-language-api) actually contains an example. If you have an habit of publishing your dotfiles, you should store these envvars in your `.localrc` instead. Well, if you know what dotfiles are, your Unix Wizardry should be able to tell you how to do that. +[^unix]: For the Unix users (Mac OSX, Linux, FreeBSD, Solaris, HPUX, etc.) reading this, you can also define envvars in your hidden `.*rc` file (e.g. `.bashrc` or `.zshrc`, depending on your shell). The method is to set that up using `export YT_CLIENTSECRET="MbOSt6cQhhFkwETXKur-L9rN"`. The envvars defined in your `.*rc` file can also be retrieved by `Sys.getenv`. The section on [Google Natural Language API](#google-natural-language-api) actually contains an example. If you have an habit of publishing your dotfiles, you should store these envvars in your `.localrc` instead. Well, if you know what dotfiles are, your Unix Wizardry should be able to tell you how to do that. -[^2]: For the people who need to use Github Actions to run or test your code, you can also store those envvars in your R code as [Github Encrypted Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets). +[^gha]: For the people who need to use Github Actions to run or test your code, you can also store those envvars in your R code as [Github Encrypted Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets). diff --git a/14-Twitter_API.Rmd b/14-Twitter_API.Rmd index e161ba2..2068475 100644 --- a/14-Twitter_API.Rmd +++ b/14-Twitter_API.Rmd @@ -6,7 +6,7 @@ * *What data/service is provided by the API?* -The API is provided by Twitter. As of 2021, there are 5 different tracks of API: [Standard (v1.1)](https://developer.twitter.com/en/docs/twitter-api/v1), [Premium (v1.1)](https://developer.twitter.com/en/docs/twitter-api/premium), [Essential (v2)](https://developer.twitter.com/en/portal/petition/essential/basic-info), [Elevated (v2)](https://developer.twitter.com/en/products/twitter-api/elevated-waitlist), and [Academic Research (v2)](https://developer.twitter.com/en/products/twitter-api/academic-research). They offer different data as well as cost differently. For academic research, one should use Standard (v1.1) or Academic Research (v2). I recommend using Academic Research (v2) track, not least because v1.1 is very restrictive for academic research and the version is now in maintenance mode (i.e. it will soon be deprecated). If one still want to use the Standard track v1.1, please see [the addendum](#addendum-twitter-v1.1) below. +The API is provided by Twitter. As of 2021, there are 5 different tracks of API: [Standard (v1.1)](https://developer.twitter.com/en/docs/twitter-api/v1), [Premium (v1.1)](https://developer.twitter.com/en/docs/twitter-api/premium), [Essential (v2)](https://developer.twitter.com/en/portal/petition/essential/basic-info), [Elevated (v2)](https://developer.twitter.com/en/products/twitter-api/elevated-waitlist), and [Academic Research (v2)](https://developer.twitter.com/en/products/twitter-api/academic-research). They offer different data as well as cost differently. For academic research, one should use Standard (v1.1) or Academic Research (v2). I recommend using Academic Research (v2) track, not least because v1.1 is very restrictive for academic research and the version is now in maintenance mode (i.e. it will soon be deprecated). If one still wants to use the Standard track v1.1, please see [the addendum](#addendum-twitter-v1.1) below. Academic Research Track provides the following data access @@ -107,7 +107,7 @@ fff_ts <- readRDS("figures/rds/twitter_ffs_ts.RDS") head(fff_ts) ``` -The daily time series of number of German tweets tweets is displayed in Figure below. However, this is not a perfect replication of the original Figure 3. It is because the original Figure only considers Fridays. [^1] The Figure below is an "enhanced remake". +The daily time series of number of German tweets tweets is displayed in Figure below. However, this is not a perfect replication of the original Figure 3. It is because the original Figure only considers Fridays. [^causal] The Figure below is an "enhanced remake". ```{r, fff_day} lockdown_date <- as.POSIXct(as.Date("2020-03-23")) @@ -130,7 +130,7 @@ I recommend thinking thoroughly whether the easy Twitter data are really suitabl The [Standard Track of Twitter v1.1 API](https://developer.twitter.com/en/docs/twitter-api/v1) is still available and probably will still be available in the near future. If one for any reason doesn't want to --- or cannot --- use the Academic Research Track, Twitter v1.1 API is still accessible using the R package `rtweet` [@kearney:2019]. -The access is relatively easy because in most cases, one only needs to have a Twitter account. Before making any actual query, `rtweet` will do the OAuth authentication automatically [^2]. +The access is relatively easy because in most cases, one only needs to have a Twitter account. Before making any actual query, `rtweet` will do the OAuth authentication automatically [^rtweet]. To "replicate" the #ichbinhanna query above: @@ -141,6 +141,6 @@ search_tweets("#ichbinhanna OR #ichwarhanna", lang = "de") However, this is not a replication. It is because the Twitter v1.1 API can only be used to search for tweets published in the last few days, whereas Academic Research Track supports full historical search. If one wants to collect a complete historical archive of tweets with v1.1, continuous collection of tweets is needed. -[^1]: To truly answer the research question, I recommend using time series causal inference techniques such as Google's [CausalImpact](https://google.github.io/CausalImpact/CausalImpact.html). +[^causal]: To truly answer the research question, I recommend using time series causal inference techniques such as Google's [CausalImpact](https://google.github.io/CausalImpact/CausalImpact.html). -[^2]: The authentication information will be stored by default to the hidden file `.rtweet_token.rds` in [home directory](https://en.wikipedia.org/wiki/Home_directory). +[^rtweet]: The authentication information will be stored by default to the hidden file `.rtweet_token.rds` in [home directory](https://en.wikipedia.org/wiki/Home_directory). diff --git a/references_overall.bib b/references_overall.bib index 31bf6cb..b85635a 100644 --- a/references_overall.bib +++ b/references_overall.bib @@ -378,7 +378,7 @@ @article{matamoros2021racism pages={205--224}, year={2021}, publisher={Sage Publications Sage CA: Los Angeles, CA}, - doi={https://doi.org/10.1177/1527476420982230} + doi={http://dx.doi.org/10.1177/1527476420982230} } @misc{newman2021reuters,