Skip to content

Commit b6f9cb8

Browse files
author
Max Czapanskiy
committed
Initial commit
0 parents  commit b6f9cb8

28 files changed

+680
-0
lines changed

.Rbuildignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
^catsr\.Rproj$
2+
^\.Rproj\.user$
3+
^data-raw$
4+
^\.github$
5+
^README\.Rmd$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
name: R-CMD-check
14+
15+
jobs:
16+
R-CMD-check:
17+
runs-on: macOS-latest
18+
env:
19+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: r-lib/actions/setup-r@v1
23+
- name: Install dependencies
24+
run: |
25+
install.packages(c("remotes", "rcmdcheck"))
26+
remotes::install_deps(dependencies = TRUE)
27+
shell: Rscript {0}
28+
- name: Check
29+
run: |
30+
options(crayon.enabled = TRUE)
31+
rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
32+
shell: Rscript {0}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
name: R-CMD-check
14+
15+
jobs:
16+
R-CMD-check:
17+
runs-on: macOS-latest
18+
env:
19+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: r-lib/actions/setup-r@v1
23+
- name: Install dependencies
24+
run: |
25+
install.packages(c("remotes", "rcmdcheck"))
26+
remotes::install_deps(dependencies = TRUE)
27+
shell: Rscript {0}
28+
- name: Check
29+
run: |
30+
options(crayon.enabled = TRUE)
31+
rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
32+
shell: Rscript {0}

.github/workflows/lint.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
- master
6+
pull_request:
7+
branches:
8+
- main
9+
- master
10+
11+
name: lint
12+
13+
jobs:
14+
lint:
15+
runs-on: macOS-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: r-lib/actions/setup-r@v1
22+
23+
- name: Query dependencies
24+
run: |
25+
install.packages('remotes')
26+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
27+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
28+
shell: Rscript {0}
29+
30+
- name: Restore R package cache
31+
uses: actions/cache@v2
32+
with:
33+
path: ${{ env.R_LIBS_USER }}
34+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
35+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
36+
37+
- name: Install dependencies
38+
run: |
39+
install.packages(c("remotes"))
40+
remotes::install_deps(dependencies = TRUE)
41+
remotes::install_cran("lintr")
42+
shell: Rscript {0}
43+
44+
- name: Install package
45+
run: R CMD INSTALL .
46+
47+
- name: Lint
48+
run: lintr::lint_package()
49+
shell: Rscript {0}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
- master
6+
pull_request:
7+
branches:
8+
- main
9+
- master
10+
11+
name: test-coverage
12+
13+
jobs:
14+
test-coverage:
15+
runs-on: macOS-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: r-lib/actions/setup-r@v1
22+
23+
- uses: r-lib/actions/setup-pandoc@v1
24+
25+
- name: Query dependencies
26+
run: |
27+
install.packages('remotes')
28+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
29+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
30+
shell: Rscript {0}
31+
32+
- name: Restore R package cache
33+
uses: actions/cache@v2
34+
with:
35+
path: ${{ env.R_LIBS_USER }}
36+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
37+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
38+
39+
- name: Install dependencies
40+
run: |
41+
install.packages(c("remotes"))
42+
remotes::install_deps(dependencies = TRUE)
43+
remotes::install_cran("covr")
44+
shell: Rscript {0}
45+
46+
- name: Test coverage
47+
run: covr::codecov()
48+
shell: Rscript {0}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData
4+
.Ruserdata
5+
.DS_Store

DESCRIPTION

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Package: catsr
2+
Title: What the Package Does (One Line, Title Case)
3+
Version: 0.0.0.9000
4+
Authors@R:
5+
person(given = "Max",
6+
family = "Czapanskiy",
7+
role = c("aut", "cre"),
8+
email = "[email protected]",
9+
comment = c("ORCID-ID" = "0000-0002-6302-905X"))
10+
Description: What the package does (one paragraph).
11+
License: MIT + file LICENSE
12+
Encoding: UTF-8
13+
Language: es
14+
LazyData: true
15+
Roxygen: list(markdown = TRUE)
16+
RoxygenNote: 7.1.1
17+
Imports:
18+
cowplot,
19+
dplyr,
20+
lubridate,
21+
patchwork,
22+
stringr
23+
Depends:
24+
R (>= 2.10)
25+
Suggests:
26+
testthat (>= 3.0.0)
27+
Config/testthat/edition: 3

NAMESPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Generated by roxygen2: do not edit by hand
2+
3+
export(read_nc)
4+
export(view_cats)
5+
import(dplyr)
6+
import(ggplot2)

R/data.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#' Sample PRH data.
2+
#'
3+
#' The PRH for a humpback whale tagged in Antarctica on March 12, 2020.
4+
#'
5+
#' @format A tibble with columns:
6+
#' * dn (num) Matlab datenum of record
7+
#' * p (num) pressure, or approximate depth in meters
8+
#' * aw (num x 3) a 3 column matrix with x, y, and z accelerometry in whale frame
9+
#' * mw (num x 3) a 3 column matrix with x, y, and z magnetometry in whale frame
10+
#' * gw (num x 3) a 3 column matrix with x, y, and z gyroscope in whale frame
11+
#' * speed (num) speed of the whale in m/s (as estimated by the jiggle method)
12+
#' * pitch (num) pitch of the whale in radians
13+
#' * roll (num) roll of the whale in radians
14+
#' * head (num) heading of the whale in radians
15+
#' * dt (POSIXct) datetime of record
16+
#' * secs (numeric) seconds since start of deployment
17+
#' * jerk (num) norm of the jerk vector
18+
#' And attributes:
19+
#' * whaleid (chr) e.g. "mn200312-58"
20+
#' * fs (num) sampling rate in Hz
21+
#' * tz (chr) local timezone e.g. "Etc/GMT+3" for UTC-3
22+
#'
23+
#' See \code{\link{read_nc}} for more details.
24+
"mn200312_58"

0 commit comments

Comments
 (0)