From b3fc6cae20f73711df23b1b4d280351e85f9c288 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Fri, 16 Nov 2018 10:02:25 +0100 Subject: [PATCH 01/16] Add default R .gitignore (+ DS_Store) --- .gitignore | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 4e64ded..f68d4d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,39 @@ -.Rproj.user -*.Rproj +# History files .Rhistory +.Rapp.history + +# Session Data files .RData -inst/doc -UvaBitsWarehouse.Rproj -*.Rproj -instal*.R -vignettes/performance-optimisation_cache -draft/ + +# Example code in package build process +*-Ex.R + +# Output files from R CMD build +/*.tar.gz + +# Output files from R CMD check +/*.Rcheck/ + +# RStudio files +.Rproj.user/ + +# produced vignettes +vignettes/*.html +vignettes/*.pdf + +# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 +.httr-oauth + +# knitr and R markdown default cache directories +/*_cache/ +/cache/ + +# Temporary files created by R markdown +*.utf8.md +*.knit.md + +# Shiny token, see https://shiny.rstudio.com/articles/shinyapps.html +rsconnect/ + +# Mac OS X +.DS_Store From b04c4c2b7ac5e9c4e8227048170be4500f501675 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Fri, 16 Nov 2018 10:04:58 +0100 Subject: [PATCH 02/16] Add .Rproj file --- uvabits.Rproj | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 uvabits.Rproj diff --git a/uvabits.Rproj b/uvabits.Rproj new file mode 100644 index 0000000..57bf3f9 --- /dev/null +++ b/uvabits.Rproj @@ -0,0 +1,21 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: knitr +LaTeX: XeLaTeX + +AutoAppendNewline: Yes +StripTrailingWhitespace: Yes + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source +PackageRoxygenize: rd,collate,namespace From 2fca6acad897fc9ca3457f6c50b785b4cb64eed7 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Fri, 16 Nov 2018 10:52:53 +0100 Subject: [PATCH 03/16] Update description + reduce version to 0.1.0.9000 --- DESCRIPTION | 58 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 75969c5..83a652b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,28 +1,36 @@ -Package: BirdTrackingEtl -Type: Package -Title: Bird tracking ETL -Version: 1.0 -Date: 2015-11-09 -Author: Bart Aelterman, -Maintainer: Bart Aelterman, -Description: Extract, Transform and Load procedures for cleaning, enriching - and loading bird tracking data into a query-optimized data store. - This package is only intended to work with data generated by the UvA-BiTS - (http://www.uva-bits.nl/) system and requires you to have set up a data store - in advance (only tested using SQLite) -License: MIT (https://tldrlegal.com/license/mit-license) -Encoding: UTF-8 -Depends: R (>= 3.2.0) +Package: uvabits +Title: Download bird tracking data from UvA-BiTS +Version: 0.1.0.9000 +Description: The uvabits package provides an R interface to the UvA-BiTS + database (http://www.uva-bits.nl/), which stores bird movement data + collected with UvA-BiTS GPS trackers. The package provides functionality to + download data and metadata, calculate some metrics, and load the data into a + query-optimized SQLite database for local analysis. It also allows to + download the data in a format that can easily be uploaded to Movebank + (https://www.movebank.org/), a free online database for animal tracking + data. +Authors@R: c( + person("Bart", "Aelterman", role = c("aut", "cre"), email = "bart.aelterman@inbo.be"), + person("Peter", "Desmet", role = "aut", email = "peter.desmet@inbo.be", comment = c(ORCID = "0000-0002-8442-8025")), + person("Stijn", "Van Hoey", role = "aut", email = "stijn.vanhoey@inbo.be", comment = c(ORCID = "0000-0001-6413-3185")) + ) +License: MIT + file LICENSE +URL: https://github.com/inbo/uvabits, https://inbo.github.io/uvabits +BugReports: https://github.com/inbo/uvabits/issues +Depends: + R (>= 3.2.0) Imports: - lubridate (== 1.5.6), - DBI (== 0.3.1), - data.table (== 1.9.6), - geosphere (== 1.3.13), - maptools (== 0.8.36), - sp (== 1.1.1), - raster (== 2.4.18) -Suggests: testthat (== 1.0.1), + data.table (== 1.9.6), + DBI (== 0.3.1), + geosphere (== 1.3.13), + lubridate (== 1.5.6), + maptools (== 0.8.36), + raster (== 2.4.18), + sp (== 1.1.1) +Suggests: knitr (== 1.11), -VignetteBuilder: knitr + testthat (== 1.0.1) LazyData: true -URL: https://github.com/inbo/bird-tracking-etl +Encoding: UTF-8 +VignetteBuilder: knitr +RoxygenNote: 6.1.1 From 0e266a2efb0c88bfbd77fbd92f823c46858eb96b Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Fri, 16 Nov 2018 10:53:09 +0100 Subject: [PATCH 04/16] Ignore .Rproj.user --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f68d4d3..475988f 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ # RStudio files .Rproj.user/ +.Rproj.user # produced vignettes vignettes/*.html From f8b1730b467729d99827f49799db450a507442c7 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Fri, 16 Nov 2018 10:54:22 +0100 Subject: [PATCH 05/16] Update reference to package in vignette --- vignettes/performance-optimisation.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vignettes/performance-optimisation.Rmd b/vignettes/performance-optimisation.Rmd index 12149bc..72c6b63 100644 --- a/vignettes/performance-optimisation.Rmd +++ b/vignettes/performance-optimisation.Rmd @@ -12,7 +12,7 @@ vignette: > ```{r global_options, include=FALSE} knitr::opts_chunk$set(fig.width=7, fig.height=6, fig.path='Figs/', warning=FALSE, message=FALSE, cache=TRUE) -library(BirdTrackingEtl) +library(uvabits) library(data.table) library(ggplot2) library(lubridate) @@ -53,4 +53,4 @@ q + theme(axis.text.x = element_text(angle = 90, hjust = 1)) (if the image isn't shown, view it [here](./Figs/profile-1.png)) -After further investigation of the `validate_tracks_data` function, this turns out to be due to the fact that parsing date_times is slow. \ No newline at end of file +After further investigation of the `validate_tracks_data` function, this turns out to be due to the fact that parsing date_times is slow. From 471af3decfb8352dfa4100d32a4cad8e68dacc9c Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 27 Feb 2019 11:19:08 +0100 Subject: [PATCH 06/16] Use title case --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 83a652b..4ac6786 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: uvabits -Title: Download bird tracking data from UvA-BiTS +Title: Download Bird Tracking Data from UvA-BiTS Version: 0.1.0.9000 Description: The uvabits package provides an R interface to the UvA-BiTS database (http://www.uva-bits.nl/), which stores bird movement data From 34aa233e68658c281b8aa812147036592269023b Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 27 Feb 2019 11:20:47 +0100 Subject: [PATCH 07/16] Use minimum versions for dependencies (rather than hardcoded) See #19. --- DESCRIPTION | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4ac6786..e7fd09a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,16 +20,16 @@ BugReports: https://github.com/inbo/uvabits/issues Depends: R (>= 3.2.0) Imports: - data.table (== 1.9.6), - DBI (== 0.3.1), - geosphere (== 1.3.13), - lubridate (== 1.5.6), - maptools (== 0.8.36), - raster (== 2.4.18), - sp (== 1.1.1) + data.table (>= 1.9.6), + DBI (>= 0.3.1), + geosphere (>= 1.3.13), + lubridate (>= 1.5.6), + maptools (>= 0.8.36), + raster (>= 2.4.18), + sp (>= 1.1.1) Suggests: - knitr (== 1.11), - testthat (== 1.0.1) + knitr (>= 1.11), + testthat (>= 1.0.1) LazyData: true Encoding: UTF-8 VignetteBuilder: knitr From 823fe1dc4d374dfa89117e80989a95a81899c8f0 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 27 Feb 2019 11:24:57 +0100 Subject: [PATCH 08/16] Create Rd files by running devtools::check() --- NAMESPACE | 2 +- man/add_dist_to_colony.Rd | 23 +++++++++++++++++++++ man/add_dist_travelled.Rd | 22 ++++++++++++++++++++ man/add_speed.Rd | 24 +++++++++++++++++++++ man/add_sunlight.Rd | 27 ++++++++++++++++++++++++ man/add_time_since_previous_fix.Rd | 25 ++++++++++++++++++++++ man/add_year_month_hour.Rd | 22 ++++++++++++++++++++ man/birds_validated.Rd | 16 ++++++++++++++ man/check_numeric_values.Rd | 23 +++++++++++++++++++++ man/data2table.Rd | 23 +++++++++++++++++++++ man/delete_test_records.Rd | 25 ++++++++++++++++++++++ man/enrich_data.Rd | 31 ++++++++++++++++++++++++++++ man/flag_outliers.Rd | 29 ++++++++++++++++++++++++++ man/join_raster_value_with_legend.Rd | 27 ++++++++++++++++++++++++ man/join_tracks_and_metadata.Rd | 25 ++++++++++++++++++++++ man/load_bird_file.Rd | 24 +++++++++++++++++++++ man/load_tracks_file.Rd | 24 +++++++++++++++++++++ man/profiling_L1.Rd | 23 +++++++++++++++++++++ man/raster_join.Rd | 21 +++++++++++++++++++ man/read_raster_data.Rd | 26 +++++++++++++++++++++++ man/read_raster_legend.Rd | 24 +++++++++++++++++++++ man/sex_choices.Rd | 14 +++++++++++++ man/species_choices.Rd | 14 +++++++++++++ man/suncalc.custom.Rd | 28 +++++++++++++++++++++++++ man/tracks_validated.Rd | 16 ++++++++++++++ man/validate_bird_data.Rd | 17 +++++++++++++++ man/validate_tracks_data.Rd | 23 +++++++++++++++++++++ 27 files changed, 597 insertions(+), 1 deletion(-) create mode 100644 man/add_dist_to_colony.Rd create mode 100644 man/add_dist_travelled.Rd create mode 100644 man/add_speed.Rd create mode 100644 man/add_sunlight.Rd create mode 100644 man/add_time_since_previous_fix.Rd create mode 100644 man/add_year_month_hour.Rd create mode 100644 man/birds_validated.Rd create mode 100644 man/check_numeric_values.Rd create mode 100644 man/data2table.Rd create mode 100644 man/delete_test_records.Rd create mode 100644 man/enrich_data.Rd create mode 100644 man/flag_outliers.Rd create mode 100644 man/join_raster_value_with_legend.Rd create mode 100644 man/join_tracks_and_metadata.Rd create mode 100644 man/load_bird_file.Rd create mode 100644 man/load_tracks_file.Rd create mode 100644 man/profiling_L1.Rd create mode 100644 man/raster_join.Rd create mode 100644 man/read_raster_data.Rd create mode 100644 man/read_raster_legend.Rd create mode 100644 man/sex_choices.Rd create mode 100644 man/species_choices.Rd create mode 100644 man/suncalc.custom.Rd create mode 100644 man/tracks_validated.Rd create mode 100644 man/validate_bird_data.Rd create mode 100644 man/validate_tracks_data.Rd diff --git a/NAMESPACE b/NAMESPACE index b5701af..edf3149 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -# Generated by roxygen2 (4.1.1): do not edit by hand +# Generated by roxygen2: do not edit by hand export(add_dist_to_colony) export(add_dist_travelled) diff --git a/man/add_dist_to_colony.Rd b/man/add_dist_to_colony.Rd new file mode 100644 index 0000000..4ff6136 --- /dev/null +++ b/man/add_dist_to_colony.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{add_dist_to_colony} +\alias{add_dist_to_colony} +\title{Add distance to colony} +\usage{ +add_dist_to_colony(dt) +} +\arguments{ +\item{dt}{tracking data as data.table. Should contain columns `latitude`, +`longitude`, `colony_latitude`, `colony_longitude`} +} +\value{ +nothing. Adds distance (in meters) in place as columns `calc_distance_to_colony` +} +\description{ +calculates the distance from the GPS position to the colony +} +\examples{ +\dontrun{ +add_dist_to_colony(tracking_data) +} +} diff --git a/man/add_dist_travelled.Rd b/man/add_dist_travelled.Rd new file mode 100644 index 0000000..a3a00c4 --- /dev/null +++ b/man/add_dist_travelled.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{add_dist_travelled} +\alias{add_dist_travelled} +\title{Add Distance travelled} +\usage{ +add_dist_travelled(dt) +} +\arguments{ +\item{dt}{tracking data as data.table} +} +\value{ +nothing. Distance (in meters) is added in place (`calc_distance_diff`) +} +\description{ +will calculate the distance travelled since previous GPS fix +} +\examples{ +\dontrun{ +add_dist_travelled(tracking_data) +} +} diff --git a/man/add_speed.Rd b/man/add_speed.Rd new file mode 100644 index 0000000..595102b --- /dev/null +++ b/man/add_speed.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{add_speed} +\alias{add_speed} +\title{Add speed} +\usage{ +add_speed(dt) +} +\arguments{ +\item{dt}{tracking data as data.table. Should contain column `calc_distance_diff` +and column `calc_time_diff`} +} +\value{ +nothing. Data is added in place as column `calc_speed_2d` +} +\description{ +calculates the average 2 dimensional speed of the individual since the +previous GPS fix +} +\examples{ +\dontrun{ +add_speed(tracking_data) +} +} diff --git a/man/add_sunlight.Rd b/man/add_sunlight.Rd new file mode 100644 index 0000000..e8fa2c9 --- /dev/null +++ b/man/add_sunlight.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{add_sunlight} +\alias{add_sunlight} +\title{Presence of sunlight} +\usage{ +add_sunlight(dt) +} +\arguments{ +\item{dt}{tracking data as data.table. Should contain columns `latitude`, `longitude` +and `date_time`.} +} +\value{ +nothing. Column `calc_sunlight` is added in place. This is a logical vector, indicating +wether sunlight was present at time and location of the GPS fix. +} +\description{ +calculate the presence of sunlight for every GPS fix. This is done +using the `suncalc` function of the package `RAtmosphere`. If the date_time of +the GPS fix is after sunrise and before sunset, presence of sunlight is 1. Otherwise +it is set to 0. +} +\examples{ +\dontrun{ +add_sunlight(tracking_data) +} +} diff --git a/man/add_time_since_previous_fix.Rd b/man/add_time_since_previous_fix.Rd new file mode 100644 index 0000000..0db6703 --- /dev/null +++ b/man/add_time_since_previous_fix.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{add_time_since_previous_fix} +\alias{add_time_since_previous_fix} +\title{Add time since previous fix} +\usage{ +add_time_since_previous_fix(datatable) +} +\arguments{ +\item{datatable}{A data.table with tracking data. Should at least include +a column `device_info_serial` and `date_time`} +} +\value{ +a new datatable with the time difference column (`calc_time_diff`) added to it. +} +\description{ +Calculates the time (in seconds) since the birds last fix. +Data is first ordered by individual and date_time. Next, for each individual +the time difference between a fix and its previous fix is calculated. +} +\examples{ +\dontrun{ +add_time_since_previous_fix(tracking_data) +} +} diff --git a/man/add_year_month_hour.Rd b/man/add_year_month_hour.Rd new file mode 100644 index 0000000..b14c953 --- /dev/null +++ b/man/add_year_month_hour.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{add_year_month_hour} +\alias{add_year_month_hour} +\title{Add year, month, hour columns} +\usage{ +add_year_month_hour(data) +} +\arguments{ +\item{dt}{Tracking data as a data.table.} +} +\value{ +Nothing, columns are added in place +} +\description{ +Add the year, month and hour of the GPS fix in separate columns +} +\examples{ +\dontrun{ +add_year_month_hour(tracks_data) +} +} diff --git a/man/birds_validated.Rd b/man/birds_validated.Rd new file mode 100644 index 0000000..292bd42 --- /dev/null +++ b/man/birds_validated.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{birds_validated} +\alias{birds_validated} +\title{Birds validated} +\format{data table} +\usage{ +birds_validated +} +\description{ +An example data table containing validated bird metadata (only 2 records). +This is what you can expect after successfully loading and validating bird +metadata. +} +\keyword{datasets} diff --git a/man/check_numeric_values.Rd b/man/check_numeric_values.Rd new file mode 100644 index 0000000..d26c5c5 --- /dev/null +++ b/man/check_numeric_values.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/extract.R +\name{check_numeric_values} +\alias{check_numeric_values} +\title{Check numeric values} +\usage{ +check_numeric_values(colname, col) +} +\arguments{ +\item{colname}{Name of the column to be tested} + +\item{col}{Column containing values to be tested} +} +\value{ +col if all values can be converted to numeric. Otherwise error. +} +\description{ +Check whether values in given column can be converted to +numeric types. If not, this function will call stop(). +} +\examples{ +check_numeric_values("testcol", c(1, 2, 3)) +} diff --git a/man/data2table.Rd b/man/data2table.Rd new file mode 100644 index 0000000..6390468 --- /dev/null +++ b/man/data2table.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/load.R +\name{data2table} +\alias{data2table} +\title{data2table} +\usage{ +data2table(dbConnection, data) +} +\arguments{ +\item{dbConnection}{a DBI database connection} + +\item{data}{A data table containing all data. See the vignette to see the required +columns and how they are written to the database.} +} +\value{ +Nothing +} +\description{ +Load all the enriched data to a RDBMS table +} +\examples{ +\dontrun{data2table(dbConnection, datatable)} +} diff --git a/man/delete_test_records.Rd b/man/delete_test_records.Rd new file mode 100644 index 0000000..a198e11 --- /dev/null +++ b/man/delete_test_records.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{delete_test_records} +\alias{delete_test_records} +\title{Delete test records} +\usage{ +delete_test_records(data) +} +\arguments{ +\item{data}{Tracking data as a data table. Data should already be joined +using the join_tracks_and_metadata function as both the date_time and the +tracking_start_date_time column are needed.} +} +\value{ +New data table without the test records +} +\description{ +Remove data that was recorded by a device before it was +mounted on the bird +} +\examples{ +\dontrun{ +delete_test_records(joined_data) +} +} diff --git a/man/enrich_data.Rd b/man/enrich_data.Rd new file mode 100644 index 0000000..4efe99e --- /dev/null +++ b/man/enrich_data.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{enrich_data} +\alias{enrich_data} +\title{Enrich data} +\usage{ +enrich_data(tracking_data, bird_data, corine_raster_data, corine_legend) +} +\arguments{ +\item{tracking_data}{Data table obtained by using the validate_tracks_data +function} + +\item{bird_data}{Bird metadata obtained by using the validate_bird_data +function} + +\item{corine_raster_data}{Filename containing corine raster data to be joined +with bird tracking data.} +} +\value{ +Data table containing enriched data +} +\description{ +Enrich the bird tracking data by precalculating attributes +and joining data with other sources. See the package vignette for a complete +description of the procedure. +} +\examples{ +\dontrun { +enrich_data(tracking_data, bird_data) +} +} diff --git a/man/flag_outliers.Rd b/man/flag_outliers.Rd new file mode 100644 index 0000000..fa3f0fe --- /dev/null +++ b/man/flag_outliers.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{flag_outliers} +\alias{flag_outliers} +\title{Flag outliers} +\usage{ +flag_outliers(dt) +} +\arguments{ +\item{dt}{tracking data as data.table.} +} +\value{ +nothing. Flagging happens in place. New columns is called `calc_outlier` +and contains logical values. +} +\description{ +Flag records that are suspect to be erronous. +The following checks are made: + - date_time < current date + - altitude < 1000 km + - speed < 33.3333 meters per second (= 120 km per hour) + - height_accuracy < 1000 +If one of these fails, the record gets flagged. +} +\examples{ +\dontrun{ +flag_outliers(tracking_data) +} +} diff --git a/man/join_raster_value_with_legend.Rd b/man/join_raster_value_with_legend.Rd new file mode 100644 index 0000000..b28e404 --- /dev/null +++ b/man/join_raster_value_with_legend.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{join_raster_value_with_legend} +\alias{join_raster_value_with_legend} +\title{Join raster value with legend} +\usage{ +join_raster_value_with_legend(dt, legend) +} +\arguments{ +\item{dt}{Data table with tracking data. Expected to contain a column `calc_raster_value` +which is the result of joining this table with a raster layer.} + +\item{legend}{a data table with the legend of the raster layer. It should contain a column +`id` and a column `value`. The `id` column should contain the values that are used in the +raster layer, while the `value` column contains the labels for these values.} +} +\value{ +New data table with an additional column "calc_raster_legend" +} +\description{ +Join the raster value with its legend +} +\examples{ +\dontrun { +join_raster_value_with_legend(datatable, legendcsv) +} +} diff --git a/man/join_tracks_and_metadata.Rd b/man/join_tracks_and_metadata.Rd new file mode 100644 index 0000000..97ff24d --- /dev/null +++ b/man/join_tracks_and_metadata.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{join_tracks_and_metadata} +\alias{join_tracks_and_metadata} +\title{Join tracks and metadata} +\usage{ +join_tracks_and_metadata(tracking_data, bird_data) +} +\arguments{ +\item{tracking_data}{Tracking data as data table} + +\item{bird_data}{Bird metadata as data table} +} +\value{ +data table containing the joined input data tables +} +\description{ +Join tracking data with bird metadata. If tracking records +are found that cannot be matched with bird metadata, the function stops. +} +\examples{ +\dontrun{ +join_tracks_and_metadata(tracks_validated, birds_validated) +} +} diff --git a/man/load_bird_file.Rd b/man/load_bird_file.Rd new file mode 100644 index 0000000..0d1c649 --- /dev/null +++ b/man/load_bird_file.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/extract.R +\name{load_bird_file} +\alias{load_bird_file} +\title{Load bird metadata file} +\usage{ +load_bird_file(filename) +} +\arguments{ +\item{filename}{The name of the file containing bird metadata} +} +\value{ +A data table (not a data frame!) containing the bird metadata +} +\description{ +Load a file containing bird metadata. This file is managed at the +INBO on Google Drive. Create a csv export of that file, and make sure it is +"," delimited. +} +\examples{ +\dontrun{ +load_bird_file(inputFile) +} +} diff --git a/man/load_tracks_file.Rd b/man/load_tracks_file.Rd new file mode 100644 index 0000000..27527aa --- /dev/null +++ b/man/load_tracks_file.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/extract.R +\name{load_tracks_file} +\alias{load_tracks_file} +\title{Load file containing bird tracking data} +\usage{ +load_tracks_file(filename) +} +\arguments{ +\item{filename}{The file containing bird tracking data in csv +format. (','-delimited, header included)} +} +\value{ +A data table (not a data frame!) containing the tracking data +} +\description{ +Load a file containing bird tracking data. This file can +be obtained by requesting a dump from the UvA-BiTS virtual lab. +} +\examples{ +\dontrun{ +load_tracks_file(inputFile) +} +} diff --git a/man/profiling_L1.Rd b/man/profiling_L1.Rd new file mode 100644 index 0000000..a75c221 --- /dev/null +++ b/man/profiling_L1.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/profiling.R +\name{profiling_L1} +\alias{profiling_L1} +\title{Profile UvA-BiTS ETL processing steps (Level 1)} +\usage{ +profiling_L1(tracks_file, birds_file) +} +\arguments{ +\item{tracks_file}{CSV file containing tracking data used for profiling. +Don't use a file that is too big (because it will take some time), but don't +make it too small either (because that can introduces biases that are not +representative)} + +\item{birds_file}{CSV file containing bird tracking metadata.} +} +\value{ +Data.Frame with two columns: "step" and "timing" +} +\description{ +Profile the different processing steps in the bird-trakcing-etl +package to find bottlenecks. +} diff --git a/man/raster_join.Rd b/man/raster_join.Rd new file mode 100644 index 0000000..426ebf4 --- /dev/null +++ b/man/raster_join.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{raster_join} +\alias{raster_join} +\title{Raster join} +\usage{ +raster_join(dt, raster_data) +} +\arguments{ +\item{dt}{Data table with tracking data. Geospatial points are created based on the +latitude and longitude field and WGS84 datum is expected.} + +\item{raster_data}{A raster data object. See the package "raster".} +} +\value{ +nothing. The value of the raster for every point is added to the data +table in place +} +\description{ +Join tracks with raster data +} diff --git a/man/read_raster_data.Rd b/man/read_raster_data.Rd new file mode 100644 index 0000000..6f2633c --- /dev/null +++ b/man/read_raster_data.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/extract.R +\name{read_raster_data} +\alias{read_raster_data} +\title{Read raster data} +\usage{ +read_raster_data(filename, data.CRS = "+init=epsg:4326") +} +\arguments{ +\item{filename}{Name of the file containing raster data} + +\item{data.CRS}{Coordinate Reference System of the data} +} +\value{ +raster data as RasterLayer class +} +\description{ +Read raster data using the raster package. By default +this function will set the CRS of this data to EPSG4326 (WGS 84). +Use the data.CRS parameter to override this. +} +\examples{ +\dontrun{ +read_raster_data("raster_file.tiff", data.CRS="+init=epsg:2056") +} +} diff --git a/man/read_raster_legend.Rd b/man/read_raster_legend.Rd new file mode 100644 index 0000000..9adaa95 --- /dev/null +++ b/man/read_raster_legend.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/extract.R +\name{read_raster_legend} +\alias{read_raster_legend} +\title{Read the raster legend} +\usage{ +read_raster_legend(filename) +} +\arguments{ +\item{filename}{Name of the csv file containing the raster legend} +} +\value{ +a data table containing the raster legend +} +\description{ +Read the raster legend. The legend is expected to contain two columns: +`id` containing the actual values used in the raster layer, and `value` which contains +the labels. +} +\examples{ +\dontrun{ +read_raster_legend("raster_legend.csv") +} +} diff --git a/man/sex_choices.Rd b/man/sex_choices.Rd new file mode 100644 index 0000000..e04cd21 --- /dev/null +++ b/man/sex_choices.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{sex_choices} +\alias{sex_choices} +\title{Sex choices} +\format{character vector} +\usage{ +sex_choices +} +\description{ +Allowed values for the sex column in bird metadata +} +\keyword{datasets} diff --git a/man/species_choices.Rd b/man/species_choices.Rd new file mode 100644 index 0000000..73b242b --- /dev/null +++ b/man/species_choices.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{species_choices} +\alias{species_choices} +\title{Species choices} +\format{character vector} +\usage{ +species_choices +} +\description{ +Allowed values for the species column in bird metadata +} +\keyword{datasets} diff --git a/man/suncalc.custom.Rd b/man/suncalc.custom.Rd new file mode 100644 index 0000000..d0ccde8 --- /dev/null +++ b/man/suncalc.custom.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/enrich.R +\name{suncalc.custom} +\alias{suncalc.custom} +\title{Calculate sunrise and sunset} +\usage{ +suncalc.custom(dates, Lat, Long) +} +\arguments{ +\item{dates}{vector containing POSIX dates} + +\item{Lat}{Latitudes in WGS84} + +\item{Long}{Longitudes in WGS84} +} +\value{ +named list with elements "sunrise" and "sunset" +} +\description{ +This function calculate the sunrise and sunset in UTC +for a given location and date. Function was slightly modified but inspired +from this post: http://www.r-bloggers.com/approximate-sunrise-and-sunset-times/ +} +\examples{ +{ +suncalc.custom(ymd("2015-01-01"), Lat=50.821, Long=4.366) +} +} diff --git a/man/tracks_validated.Rd b/man/tracks_validated.Rd new file mode 100644 index 0000000..dd8c56b --- /dev/null +++ b/man/tracks_validated.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{tracks_validated} +\alias{tracks_validated} +\title{Tracks validated} +\format{data table} +\usage{ +tracks_validated +} +\description{ +An example data table containing validated bird tracking data (only 100 +records). This is what you can expect after successfully loading and +validating tracking data. +} +\keyword{datasets} diff --git a/man/validate_bird_data.Rd b/man/validate_bird_data.Rd new file mode 100644 index 0000000..9685ca6 --- /dev/null +++ b/man/validate_bird_data.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/extract.R +\name{validate_bird_data} +\alias{validate_bird_data} +\title{Validate bird data} +\usage{ +validate_bird_data(bird_data) +} +\arguments{ +\item{bird_data}{The bird metadata as a data table} +} +\value{ +validated bird metadata as a data table if no errors are found. +} +\description{ +Validate the bird metadata +} diff --git a/man/validate_tracks_data.Rd b/man/validate_tracks_data.Rd new file mode 100644 index 0000000..7604f62 --- /dev/null +++ b/man/validate_tracks_data.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/extract.R +\name{validate_tracks_data} +\alias{validate_tracks_data} +\title{Validate tracking data} +\usage{ +validate_tracks_data(tracks_data) +} +\arguments{ +\item{tracks_data}{The tracking data as a data table} +} +\value{ +validated tracking data as a data table if no errors are found. +} +\description{ +Validate the data coming either from a csv file or +from the UvA-BiTS virtual lab directly. +} +\examples{ +\dontrun{ +validate_tracks_data(tracking_data) +} +} From 6d00c77d37fc56aed599545ab063821786342c14 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 27 Feb 2019 11:33:44 +0100 Subject: [PATCH 09/16] Move vignette figures --- ...ate_time_parsing-1.png => date_time_parsing.png} | Bin vignettes/performance-optimisation.Rmd | 5 ++--- vignettes/{Figs/profile-1.png => profile.png} | Bin 3 files changed, 2 insertions(+), 3 deletions(-) rename vignettes/{Figs/date_time_parsing-1.png => date_time_parsing.png} (100%) rename vignettes/{Figs/profile-1.png => profile.png} (100%) diff --git a/vignettes/Figs/date_time_parsing-1.png b/vignettes/date_time_parsing.png similarity index 100% rename from vignettes/Figs/date_time_parsing-1.png rename to vignettes/date_time_parsing.png diff --git a/vignettes/performance-optimisation.Rmd b/vignettes/performance-optimisation.Rmd index 72c6b63..24e22bb 100644 --- a/vignettes/performance-optimisation.Rmd +++ b/vignettes/performance-optimisation.Rmd @@ -38,19 +38,18 @@ q <- qplot(x=c("ymd_hms", "fast_strptime"), y=c(ymd_hms_time, fast_strptime_time q + geom_point() ``` -(See figure [here](Figs/date_time_parsing-1.png)) +(See figure [here](./date_time_parsing.png)) So, `ymd_hms` was replaced by `fast_strptime`. This cut off 73% of the `track_validation` step processing time. ## Profiling the different UvABiTSETL steps - ```{r profile} d <- profiling_L1("../data/bird_track_logs_2000L.csv", "../data/two_birds.csv") q <- qplot(x=d$step, y=d$timing) q + theme(axis.text.x = element_text(angle = 90, hjust = 1)) ``` -(if the image isn't shown, view it [here](./Figs/profile-1.png)) +(if the image isn't shown, view it [here](./profile.png)) After further investigation of the `validate_tracks_data` function, this turns out to be due to the fact that parsing date_times is slow. diff --git a/vignettes/Figs/profile-1.png b/vignettes/profile.png similarity index 100% rename from vignettes/Figs/profile-1.png rename to vignettes/profile.png From 61b1e7f52ad824703fd703ae3dbcf99663538a7b Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 27 Feb 2019 13:11:03 +0100 Subject: [PATCH 10/16] Move sql (referenced in vignettes) to vignettes --- vignettes/bird-tracking-etl.Rmd | 2 +- {sql => vignettes}/create_wh_table.sql | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {sql => vignettes}/create_wh_table.sql (100%) diff --git a/vignettes/bird-tracking-etl.Rmd b/vignettes/bird-tracking-etl.Rmd index c94271f..27fc77a 100644 --- a/vignettes/bird-tracking-etl.Rmd +++ b/vignettes/bird-tracking-etl.Rmd @@ -57,7 +57,7 @@ con <- dbConnect(drv, dbname="bird_tracking", host="localhost") data2table(con, dt) ``` -To add indexes to the table, perform the `CREATE INDEX` statements in [this file](../sql/create_wh_table.sql). +To add indexes to the table, perform the `CREATE INDEX` statements in [this file](./create_wh_table.sql). ## Output format diff --git a/sql/create_wh_table.sql b/vignettes/create_wh_table.sql similarity index 100% rename from sql/create_wh_table.sql rename to vignettes/create_wh_table.sql From b947e81a2cd35fca0885a0e03796cf43f62c3a14 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 27 Feb 2019 13:13:10 +0100 Subject: [PATCH 11/16] Extend .Rbuildignore --- .Rbuildignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.Rbuildignore b/.Rbuildignore index 91114bf..b5bdfcb 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,11 @@ ^.*\.Rproj$ ^\.Rproj\.user$ +^README\.Rmd$ +^README-.*\.png$ +^\.travis\.yml$ +^appveyor\.yml$ +^docs$ +^_pkgdown\.yml$ +^CODE_OF_CONDUCT\.md$ +^CONTRIBUTING\.md$ +.github/ From 67be5575c5bd6c2911bb29adf04a0d26e60c2a9e Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 27 Feb 2019 14:33:47 +0100 Subject: [PATCH 12/16] Update README (cf. wateRinfo) --- README.md | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index ca18b9a..08df54f 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,26 @@ -# UvA-BiTS ETL +# uvabits -## Background -At [the Research Institute for Nature and Forest](http://www.inbo.be), we're tracking large birds as part of [our LifeWatch contribution](http://lifewatch.inbo.be). We are using small solar-powered GPS devices, developed by [UvA-BiTS](http://www.uva-bits.nl). The data are stored in the UvA-BiTS virtual lab and we frequently get a dump from that database on which we work. As tracking data volume grows quicker than human observation data (what we usually work with), we were in need for a data store that contains the cleaned and enriched tracking data in a system that is optimized for querying these *large-ish* data sets. Something like a data warehouse. This R package contains code to extract the data from the UvA-BiTS virtual lab, clean and enrich it, and load it in the data warehouse. +uvabits provides an R interface to the [UvA-BiTS database](http://www.uva-bits.nl/), which stores bird movement data collected with UvA-BiTS GPS trackers. The package provides functionality to download data and metadata, calculate some metrics, and load the data into a query-optimized SQLite database for local analysis. It also allows to download the data in a format that can easily be uploaded to [Movebank](https://www.movebank.org/), a free online database for animal tracking data. -## Install the package +## Installation -The package is not on CRAN. If you want to use it, download a copy of the code here, and [install it from source](http://stackoverflow.com/questions/1474081/how-do-i-install-an-r-package-from-source). You need a few third party packages, as documented in the package [DESCRIPTION](./DESCRIPTION). R should take care of that. If not, install `lubridate`, `data.table`, `geosphere`, `sp` and `DBI`. If you want to run the tests, you'll need `testthat` too. - -## Run the tests - -Tests are written using [testthat](https://github.com/hadley/testthat). Run the tests in RStudio by opening the package main directory and pressing CTRL/CMD + SHIFT + T. - -## Load the package +You can install uvabits from [GitHub](https://github.com/inbo/uvabits) with: -``` -library(BirdTrackingEtl) +```r +# install.packages("devtools") +devtools::install_github("inbo/uvabits") ``` -## How to use the package +Then load the package with: -This is explained in the package [vignette](./vignettes/bird-tracking-etl.Rmd). +```r +library(uvabits) +``` -## Get in touch +## Meta -Should you encounter issues while using this package, get in touch by [filing an issue](https://github.com/LifeWatchINBO/bird-tracking-etl/issues). +* We welcome [contributions](.github/CONTRIBUTING.md) including bug reports. +* License: MIT +* Get citation information for `uvabits` in R doing `citation("uvabits")`. +* Please note that this project is released with a [Contributor Code of Conduct](.github/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. \ No newline at end of file From 8acda3883b1817182ec4247de3f21799c192b0f0 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 27 Feb 2019 14:33:58 +0100 Subject: [PATCH 13/16] Add warning regarding status of package --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 08df54f..1790aeb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # uvabits +> ✋ This package is not ready for use! It was previously called `BirdTrackingEtl` and used exclusively to process UvA-BiTS data for INBO researchers (see [release](https://github.com/inbo/uvabits/releases/tag/bt-etl) and [vignette](vignettes/bird-tracking-etl.Rmd) for that version). We are now expanding its functionality for more general use by UvA-BiTS users. Want to contribute? Check out our [contributing guidelines](.github/CONTRIBUTING.md). uvabits provides an R interface to the [UvA-BiTS database](http://www.uva-bits.nl/), which stores bird movement data collected with UvA-BiTS GPS trackers. The package provides functionality to download data and metadata, calculate some metrics, and load the data into a query-optimized SQLite database for local analysis. It also allows to download the data in a format that can easily be uploaded to [Movebank](https://www.movebank.org/), a free online database for animal tracking data. From a41b93054159fc86230ff404af06c2f310e26a25 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 27 Feb 2019 14:35:39 +0100 Subject: [PATCH 14/16] Create CODE_OF_CONDUCT.md --- .github/CODE_OF_CONDUCT.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/CODE_OF_CONDUCT.md diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..24aa0a3 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,25 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free experience for +everyone, regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. + +Examples of unacceptable behavior by participants include the use of sexual language or +imagery, derogatory comments or personal attacks, trolling, public or private harassment, +insults, or other unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, +commits, code, wiki edits, issues, and other contributions that are not aligned to this +Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed +from the project team. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by +opening an issue or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the Contributor Covenant +(http://contributor-covenant.org), version 1.0.0, available at +http://contributor-covenant.org/version/1/0/0/ From 3389462a50f8586bb8082d16e47fc33392305adf Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 27 Feb 2019 14:48:03 +0100 Subject: [PATCH 15/16] Add a contributing guide Based on https://gist.github.com/peterdesmet/e90a1b0dc17af6c12daf6e8b2f044e7c --- .github/CONTRIBUTING.md | 84 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..f36a055 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,84 @@ +# Contributing to uvabits + +First of all, thanks for considering contributing to uvabits! 👍 It's people like you that make it rewarding for us - the project maintainers - to work on uvabits. 😊 + +uvabits is an open source project, maintained by people who care. We are not directly funded to do so. + +[repo]: https://github.com/inbo/uvabits +[issues]: https://github.com/inbo/uvabits/issues +[new_issue]: https://github.com/inbo/uvabits/issues/new +[website]: https://inbo.github.io/uvabits +[citation]: https://inbo.github.io/uvabits/authors.html +[email]: mailto:peter.desmet@inbo.be + +## Code of conduct + +Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. + +## How you can contribute + +There are several ways you can contribute to this project. If you want to know more about why and how to contribute to open source projects like this one, see this [Open Source Guide](https://opensource.guide/how-to-contribute/). + +### Share the love ❤️ + +Think uvabits is useful? Let others discover it, by telling them in person, via Twitter or a blog post. + +Using uvabits for a paper you are writing? Consider [citing it][citation]. + +### Ask a question ⁉️ + +Using uvabits and got stuck? Browse the [documentation][website] to see if you can find a solution. Still stuck? Post your question as an [issue on GitHub][new_issue]. While we cannot offer user support, we'll try to do our best to address it, as questions often lead to better documentation or the discovery of bugs. + +Want to ask a question in private? Contact the package maintainer by [email][email]. + +### Propose an idea 💡 + +Have an idea for a new uvabits feature? Take a look at the [documentation][website] and [issue list][issues] to see if it isn't included or suggested yet. If not, suggest your idea as an [issue on GitHub][new_issue]. While we can't promise to implement your idea, it helps to: + +* Explain in detail how it would work. +* Keep the scope as narrow as possible. + +See below if you want to contribute code for your idea as well. + +### Report a bug 🐛 + +Using uvabits and discovered a bug? That's annoying! Don't let others have the same experience and report it as an [issue on GitHub][new_issue] so we can fix it. A good bug report makes it easier for us to do so, so please include: + +* Your operating system name and version (e.g. Mac OS 10.13.6). +* Any details about your local setup that might be helpful in troubleshooting. +* Detailed steps to reproduce the bug. + +### Improve the documentation 📖 + +Noticed a typo on the website? Think a function could use a better example? Good documentation makes all the difference, so your help to improve it is very welcome! + +#### The website + +[This website][website] is generated with [`pkgdown`](http://pkgdown.r-lib.org/). That means we don't have to write any html: content is pulled together from documentation in the code, vignettes, [Markdown](https://guides.github.com/features/mastering-markdown/) files, the package `DESCRIPTION` and `_pkgdown.yml` settings. If you know your way around `pkgdown`, you can [propose a file change](https://help.github.com/articles/editing-files-in-another-user-s-repository/) to improve documentation. If not, [report an issue][new_issue] and we can point you in the right direction. + +#### Function documentation + +Functions are described as comments near their code and translated to documentation using [`roxygen2`](https://klutometis.github.io/roxygen/). If you want to improve a function description: + +1. Go to `R/` directory in the [code repository][repo]. +2. Look for the file with the name of the function. +3. [Propose a file change](https://help.github.com/articles/editing-files-in-another-user-s-repository/) to update the function documentation in the roxygen comments (starting with `#'`). + +### Contribute code 📝 + +Care to fix bugs or implement new functionality for uvabits? Awesome! 👏 Have a look at the [issue list][issues] and leave a comment on the things you want to work on. See also the development guidelines below. + +## Development guidelines + +We try to follow the [GitHub flow](https://guides.github.com/introduction/flow/) for development. + +1. Fork [this repo][repo] and clone it to your computer. To learn more about this process, see [this guide](https://guides.github.com/activities/forking/). +2. If you have forked and cloned the project before and it has been a while since you worked on it, [pull changes from the original repo](https://help.github.com/articles/merging-an-upstream-repository-into-your-fork/) to your clone by using `git pull upstream master`. +3. Open the RStudio project file (`.Rproj`). +5. Make your changes: + * Write your code. + * Test your code (bonus points for adding unit tests). + * Document your code (see function documentation above). + * Do an `R CMD check` using `devtools::check()` and aim for 0 errors and warnings. +5. Commit and push your changes. +6. Submit a [pull request](https://guides.github.com/activities/forking/#making-a-pull-request). From 83c64972a54b9cabfbe9f1d703fa9c4ee692c0e3 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 27 Feb 2019 14:51:24 +0100 Subject: [PATCH 16/16] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..114ff0a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2015 Research Institute for Nature and Forest (INBO) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.