Giter Site home page Giter Site logo

rikudoukarthik / covid-ebirding Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.42 GB

Code and analyses associated with Thrikkadeeri & Viswanathan, in review, on how the COVID-19 pandemic has affected eBirding and bird species reporting

R 26.03% HTML 0.07% CSS 2.36% JavaScript 0.03% RMarkdown 69.03% Lua 2.48%
birdwatching coronavirus covid-19 ebird

covid-ebirding's Introduction

Effects of COVID-19 pandemic on eBirding and birds in India

This repository contains the source code and data associated with a study on the effects of the COVID-19 pandemic on eBirding (Thrikkadeeri & Viswanathan 2024) and bird species reporting (Thrikkadeeri & Viswanathan, in prep.) in India. All analyses were performed in the R environment in RStudio, and with the addition of a couple of large (publicly available) data files that need to be procured externally (see below), the source code and files in this repo will allow the analyses to be fully reproduced.

The structure and workflow for the main analysis is outlined below.

Data

External

The analysis is centred around eBird data from India, which is publicly available but is a very large file.

  • eBird Basic Dataset (EBD), relMay-2022: The current version of this dataset is much more recent and contains data after May 2022, but filtering it should produce a fairly similar dataset to the ones used in this study, with only minor changes.
  • eBird sensitive species data, relMay-2022: Data on sensitive species data is not included in the public download, and was obtained after requesting separately from eBird. (Only required for bird reporting analyses, i.e., manuscript #2.)
  • Spatial polygon data of admin. unit boundaries

Reproducible

  • MODIS Land Cover Type Product MCD12Q1: The data used in the study is available in 00_data/in_LULC_MODIS/ & 00_data/rast_UNU.RData, but it is recommended to delete those files before starting the analysis. This will then force getmodisdata() from 00_scripts/functions.R to run and produce fresh LULC data files from MODIS.
  • Timeline of COVID classification: Available 00_data/covid_classification.csv. Classification of the timeline of interest into various COVID categories.

Reproduce results of Thrikkadeeri & Viswanathan 2024

Only the following data files, which are filtered, processed and prepared to be input into the analyses, are required to reproduce our results. These are mostly .Rdata files that can be readily imported into R (all analyses were performed in the R environment using RStudio).

  • The processed version of EBD ready for analyses is 00_data/data0_MY_d_slice.RData
  • Shapefiles: 00_data/maps_sf.RData contains admin unit polygons, and 00_data/grids_st_sf.RData contains country-wide grids of multiple resolutions
  • The processed MODIS land cover data is available as 00_data/rast_UNU.RData, but deleting this before starting the analysis will force fresh LULC data files from MODIS to be produced from the script
  • Classification of the timeline of interest into various COVID categories, available as 00_data/covid_classification.csv

Workflow

Data preparation

03_wrap.Rmd is the place to start for the main analyses. This loads all necessary data (and processes it where required), packages and other 00_scripts/functions. It is essentially a setup file.

Lines 80--92 should be unhashed when running the analysis for the first time, as this will activate data_qualfilt_prep() from 00_scripts/functions.R. In subsequent runs, the lines can be hashed again, since various .RData and other data files will have been generated in the original data filtering, processing and preparation step.

Analysis

Then, the analyses can be run. The study is divided into two broad sections, one dealing with changes in birding and birder behaviour, and the other with changes in bird species reporting. Hence, the analysis is also split into two files, 04_birder.Rmd and 05_bird.Rmd. The contents of both these files are self-explanatory; they run various analyses, and generate and store outputs of the analyses such as figures (03_wrap_figs/) and summary data (00_outputs/), which can be directly utilised further downstream.

Manuscript

Once the full analysis has been successfully run (and outputs generated and stored), the final manuscript can also be reproduced (and validated), since it is an .Rmd file and most summaries and results in it (textual or graphical) are obtained directly from the data and analysis outputs.

The full manuscript is divided into the main manuscript (11_manuscript.Rmd) and the supplementary material (12_manuscript_supp.Rmd). index.Rmd uses bookdown (see _bookdown.yml) to combine the two and produce the final document (_book/_main.docx). This building of the book is executed by bookdown::render_book(). This step requires a template .docx file, containing all necessary formatting rules and styles, to be present in the repository---in this case, named rmd_word_template_journ_guide.docx, which needs to be created separately. The bibliography for this study (covid-ebirding.json) and citation style language (CSL) for the journal of interest (ibis.csl) are also necessary.

A separate title page containing author affiliations, acknowledgements, etc. can be knitted directly from 13_titlepage.Rmd, without having to build a book.

Some aspects or elements of the final manuscript are non-reproducible. They are detailed below.

Model summary tables

Due to the difficulty in converting the raw summary objects of LMMs/GLMMs into informative summary tables programmatically, the current heuristic is to take fixed effects information directly from the model summary output (00_outputs/) into a simple and neat table using knitr::kable(), while the random effects information as well as other elements of the table caption are altered manually each time. See last section of 12_manuscript_supp.Rmd for details.

Main text and supplementary material

The reason for using bookdown::render_book() (instead of simply knitting the two documents separately) is to allow easy cross-referencing of sections, figures, tables, etc. between the main text and the supplementary material. However, one disadvantage is that there is no easy way to restart numbering of sections, figures, tables, etc. from a given section onwards or to add a prefix to the numbering.

Therefore, the manual steps followed are:

  1. Create two copies of the final document (_book/_main.docx). In the first, manually delete all text from the supplementary section onwards. In the second, delete all text until the supplementary section.
  2. Adjust the numbering of supplementary sections.
    • In the supplementary document, find and replace "7." with "". This removes the unnecessary tier of numbering.
    • In the main document, find and replace "7." with "S". This adds the prefix "S" to all in-text references to supplementary sections.
  3. Manually adjust the numbering of x supplementary figures and tables one-by-one (for x from 1 to 46).
    • In the supplementary document, find and replace "Figure x" or "Fig. x" with "Figure x-8" or "Fig. x-8" respectively (because there 8 figures in the main document). Similarly, find and replace "Table x" with "Table x-2" (because there 2 tables in the main document).
    • In the main document, find and replace "Figure x" or "Fig. x" with "Figure Sx-8" or "Fig. Sx-8" respectively, and "Table x" with "Table Sx-2". This adds the prefix "S" to all in-text references to supplementary sections.

Separate figure legends

The journal requires all individual figure legends in the main manuscript to be listed together at the end of the document. For this, simply copy-paste the 8 figure legends one-by-one in the last section.

Separate Conflict of Interest statement

The journal requires the CoI statement to be provided separately as well. The steps are:

  1. Create a copy of the title page document generated from 13_titlepage.Rmd.
  2. Retain only the title and CoI section.
  3. Add a closing section to sign off the document, including a digital version of the corresponding author's signature.

covid-ebirding's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.