Giter Site home page Giter Site logo

rafnuss / geopressuretemplate Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 125.64 MB

Template repository to analyse geolocation with a GeoPressureR

Home Page: https://raphaelnussbaumer.com/GeoPressureTemplate/

License: Creative Commons Attribution 4.0 International

Glyph 99.93% R 0.07%
bird distill geolocation migration r geopressurer

geopressuretemplate's Introduction

GeoPressureTemplate

Analyzing geolocator data with GeoPressureR is full of potential, but the the path is long and the journey can be challenging. GeoPressureTemplate provides a start-up R project to make that journey easier.

This Github repository template contains a standard project folder structure and R script to store your data, analyse it, and produce outputs.

โš ๏ธ To use this template, you must be familiar with the full GeoPressureR workflow, described in the GeoPressureManual.

๐Ÿ“ Project structure

We defined a standardized project folder structure based on a mix of rrrpkg, rrtools and cookiecutter data science.

GeoPressureTemplate/
โ”œโ”€โ”€ DESCRIPTION                             # Project metadata and dependencies
โ”œโ”€โ”€ README.md                               # Top-level description of content and guide to users
โ”œโ”€โ”€ GeoPressureTemplate.Rproj               # R project file
โ”œโ”€โ”€ LICENCES.md                             # Conditions of re/use the data and code
โ”œโ”€โ”€ config.yml                              # YML file used to defined the parameters used in the analysis
โ”œโ”€โ”€ data/                                 
โ”‚   โ”œโ”€โ”€ raw_tag/                            # Raw geolocator data (do not modify!)
โ”‚   โ”‚   โ”œโ”€โ”€ 18LX/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ 18LX_20180725.acceleration
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ 18LX_20180725.glf
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ 18LX_20180725.pressure 
โ”‚   โ”‚   โ””โ”€โ”€ CB619/ 
โ”‚   โ”‚       โ””โ”€โ”€ CB619.deg
โ”‚   โ”œโ”€โ”€ tag_label/                          # Trainset csv file generated with analyis/1-label.qmd
โ”‚   โ”‚   โ”œโ”€โ”€ 18LX-labeled.csv
โ”‚   โ”‚   โ”œโ”€โ”€ 18LX.csv 
โ”‚   โ”‚   โ”œโ”€โ”€ CB619-labeled.csv
โ”‚   โ”‚   โ””โ”€โ”€ CB619.csv            
โ”‚   โ”œโ”€โ”€ twilight_label/                     # Trainset csv file generated with analyis/2-twilight.qmd
โ”‚   โ”‚   โ”œโ”€โ”€ 18LX-labeled.csv
โ”‚   โ”‚   โ””โ”€โ”€ 18LX.csv
โ”‚   โ”œโ”€โ”€ wind/                               # ERA-5 wind data generated with analyis/3-wind.qmd
โ”‚   โ”‚   โ””โ”€โ”€ 18LX/
โ”‚   โ”‚       โ”œโ”€โ”€ 18LX_1.nc
โ”‚   โ”‚       โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ interim/                            # Intermediate data, typically .RData or .Rds
โ”‚       โ””โ”€โ”€ 18LX.RData                      
โ”œโ”€โ”€ analysis/                               # R code used to analyse your data.
โ”‚   โ”œโ”€โ”€ 1-label.qmd
โ”‚   โ”œโ”€โ”€ 2-twilight.qmd
โ”‚   โ”œโ”€โ”€ 3-wind.qmd
โ”‚   โ”œโ”€โ”€ 4-geopressure.R
โ””โ”€โ”€ output/   
    โ”œโ”€โ”€ create_figures.R
    โ””โ”€โ”€ figures/

๐Ÿ’ก Get started

๐Ÿ› ๏ธ Create your project

Option 1: with a Github repository (recommended)

  • Create your project repo by clicking on the green button "Use this template".
  • Choose a project name (e.g., my_tracking_study_name) specific to your research. Note that this will become the name of your folder on your computer too.
  • Clone the repository on your computer.
  • Done! ๐ŸŽ‰

Option 2: without a Github repository

  • Download the repo by clicking on the green button Code and Download ZIP
  • Unzip and rename the folder name to your own project name.
  • Done! ๐ŸŽ‰

๐Ÿ  Make yourself at home

  1. Rename GeoPressureTemplate.Rproj to your study name (e.g., my_tracking_study_name.Rproj). You can now open the project on RStudio.
  2. Edit the DESCRIPTION file (see https://r-pkgs.org/description.html for details).
  3. Delete the content of README.md and write your research objectives, describing your basic data, method etc.
  4. Replace the content of data/ with your tag data.
  5. Install the dependencies needed with
devtools::install()
  1. Optionally, modify the LICENCES.md file (see https://r-pkgs.org/license.html for details).

What is the config.yml file?

Before jumping into the analysis, we need to introduce config.yml. It's a YAML file which defines the parameters used in the analysis. Separating these parameters from the main code follows best practices in terms of reproducibility, readability, and sharability. We use the config R package to retrieve the parameter values in the code with,

config::get("crop_start", config = "18LX") # "2017-06-20"

One advantage of this file is the ability to define a default set of parameters (i.e. valid for all tags), as well as specific parameters for each tag.

config::get("thr_gs", config = "18LX") # 150

๐Ÿ“ˆ Analyse the data

Now that you are set up, it's time to get serious ๐Ÿ˜ฌ

Step 1: Preparation

In this first step, we will make sure everything is ready to run the model. This involves setting up the parameters in config.yml while running the following three scripts:

  1. Run 1-label.qmd
  2. (optional) 2-twilight.qmd
  3. (optional) 3-wind.qmd

While doing so, please keep in mind: - Nothing is saved at the end of the script (and that's how it's supposed to be!). Only label files and config.yml should be edited. - The scripts should be run successively for each tag separately - We use quarto script to make it easy to run chunks based on your needs (e.g., re-run a small chunk after making a change). The scripts are not meant to be run with "Run all". - These scripts should be adapted based on your project, but the same script should run for all your tags.

Step 2: Compute the trajectory

The main script is 4-geopressure.R

Step 3: Your own analyis

Publication

For peer-review publication, it is essential that the data and code are accessible to reviewer. Because inaccurate labeling can lead to wrong trajectory, we highly encourage you to publish your data and code on Zenodo. This is made very easy using this github repository and this guide. This process will generate a DOI for your data and code which can be used in your repository. Here is an ey (e.g., https://zenodo.org/record/7471405)

What it needs to include:

๐Ÿ”— Advanced options

geopressuretemplate's People

Contributors

amelinenussbaumer avatar rafnuss avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

geopressuretemplate's Issues

v3 possible structure

rrrpkg

https://github.com/ropensci/rrrpkg#getting-started-with-a-research-compendium
Old, not updated but then that is expected for a project folder structure. Everything seems to fit well with this exept from data/

Cookiecutter Data Science

http://drivendata.github.io/cookiecutter-data-science/#directory-structure

rrtools

https://github.com/benmarwick/rrtools#4-rrtoolsuse_analysis

General structure

GeoPressureTemplate
โ”œโ”€โ”€ GeoPressureTemplate.Rproj               # R project file
โ”œโ”€โ”€ DESCRIPTION          		                # project metadata and dependencies
โ”œโ”€โ”€ README.Rmd            		                # top-level description of content and guide to users
โ”œโ”€โ”€ README.md            		                # top-level description of content and guide to users
โ”œโ”€โ”€ LICENSE           		                # top-level description of content and guide to users
โ”œโ”€โ”€ data                                    # Folder structured by order of use
โ”œโ”€โ”€ analysis                                # R code used to analyse your data. Follow the order
โ”‚   โ”œโ”€โ”€ tag_create
โ”‚   โ”œโ”€โ”€ tag_label
โ”‚   โ”œโ”€โ”€ geopressure
โ”‚   โ”œโ”€โ”€ geolight
โ”‚   โ”œโ”€โ”€ graph
โ”‚   โ””โ”€โ”€ ouput? 
โ”œโ”€โ”€ R (optional)
โ”‚   โ””โ”€โ”€ custom_function.R        # 
โ”œโ”€โ”€ man (optional - auto-generated when using devtools)
โ”‚   โ””โ”€โ”€ custom_function.R        # 
โ”œโ”€โ”€ tests
โ”‚   โ””โ”€โ”€ testthat.R        # unit tests of R functions to ensure they perform as expected
โ””โ”€โ”€ reports                                 # Generate HTML report to be shared (see below for details)
โ”‚   โ”œโ”€โ”€ _basic_trajectory.Rmd
โ”‚   โ”œโ”€โ”€ _site.yml
โ”‚   โ”œโ”€โ”€ _technical_details.Rmd
โ”‚   โ”œโ”€โ”€ basic_trajectory
โ”‚   โ”‚   โ””โ”€โ”€ 18LX.html
โ”‚   โ”œโ”€โ”€ technical_details
โ”‚   โ”‚   โ””โ”€โ”€ 18LX.html
โ”‚   โ”œโ”€โ”€ index.Rmd
โ”‚   โ””โ”€โ”€ make_reports.R
โ””โ”€โ”€ docs                                      # Folder where your reports will be served as a website on Github Page
    โ””โ”€โ”€ ...

Data

โ”œโ”€โ”€ data
โ”‚   โ”œโ”€โ”€ external       <- Data from third party sources.
โ”‚   โ”œโ”€โ”€ interim        <- Intermediate data that has been transformed.
โ”‚   โ”œโ”€โ”€ processed      <- The final, canonical data sets for modeling.
โ”‚   โ””โ”€โ”€ raw            <- The original, immutable data dump.
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ raw_data/       # data obtained from elsewhere
โ”‚   โ””โ”€โ”€ derived_data/   # data generated during the analysis
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ raw_data/       # data obtained from elsewhere
โ”‚   โ””โ”€โ”€ derived_data/   # data generated during the analysis

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.