Skip to content

Commit

Permalink
Merge pull request #11 from nutriverse/dev
Browse files Browse the repository at this point in the history
refresh repository
  • Loading branch information
ernestguevarra committed Apr 9, 2024
2 parents 84c212b + 6da797c commit 8dcfd6c
Show file tree
Hide file tree
Showing 22 changed files with 183 additions and 97 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -47,3 +47,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: docs
8 changes: 4 additions & 4 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -31,20 +31,20 @@ jobs:
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.Ruserdata
.DS_Store
inst/doc
docs
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: anthrocheckr
Type: Package
Title: Anthropometric Measurement Standardisation Tests
Version: 0.1.0
Version: 0.0.0.9000
Authors@R: person(given = "Ernest",
family = "Guevarra",
comment = c(ORCID = "0000-0002-4887-4415"),
Expand All @@ -26,13 +26,14 @@ Suggests:
openxlsx,
shinydashboard,
spelling,
testthat,
testthat (>= 3.0.0),
dplyr,
covr
Encoding: UTF-8
Language: en-GB
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
URL: https://nutriverse.io/anthrocheckr/, https://github.com/nutriverse/anthrocheckr
BugReports: https://github.com/nutriverse/anthrocheckr/issues
VignetteBuilder: knitr
Config/testthat/edition: 3
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# anthrocheckr v0.1.0
# anthrocheckr v0.0.0.9000

This is the first CRAN release of `anthrocheckr`.
This is a pre-release of `anthrocheckr`.
6 changes: 2 additions & 4 deletions R/00_anthrocheckr.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
#
#'
#' An Implementation of Anthropometric Measurement Standardisation Tests
#'
#' Ensuring the precision and accuracy of measurements is critical when
#' collecting anthropometric data. Anthropometrists are usually tested for
Expand All @@ -15,6 +15,4 @@
#' @importFrom shiny runApp
#' @importFrom methods is
#'
#
################################################################################
"_PACKAGE"
12 changes: 0 additions & 12 deletions R/01_summary_measure.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
################################################################################
#
#'
#' Calculate the mean, sd and maximum difference value of
#' measurements/observations
Expand Down Expand Up @@ -59,8 +57,6 @@
#' @rdname calculate_summary
#' @export
#'
#
################################################################################

calculate_mean <- function(measures, index = NULL) {
if (is.null(index)) {
Expand All @@ -75,14 +71,10 @@ calculate_mean <- function(measures, index = NULL) {
}


################################################################################
#
#'
#' @rdname calculate_summary
#' @export
#'
#
################################################################################

calculate_sd <- function(measures, index = NULL) {
if (is.null(index)) {
Expand All @@ -96,14 +88,10 @@ calculate_sd <- function(measures, index = NULL) {
}


################################################################################
#
#'
#' @rdname calculate_summary
#' @export
#'
#
################################################################################

calculate_max <- function(measures, index = NULL) {
if (is.null(index)) {
Expand Down
4 changes: 0 additions & 4 deletions R/02_calculate_tem.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
################################################################################
#
#'
#' Calculate technical error of measurement (TEM)
#'
Expand All @@ -26,8 +24,6 @@
#'
#' @export
#'
#
################################################################################

calculate_tem <- function(d, n) {
## TEM formula
Expand Down
14 changes: 6 additions & 8 deletions R/03_calculate_tem_cohort.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
################################################################################
#
#'
#' Calculate intra-observer TEM for each observer
#'
Expand Down Expand Up @@ -33,8 +31,6 @@
#'
#' @export
#'
#
################################################################################

calculate_tem_cohort <- function(df, m1, m2, index = NULL, n) {
## Check that m1 is a numeric vector
Expand All @@ -48,10 +44,12 @@ calculate_tem_cohort <- function(df, m1, m2, index = NULL, n) {
}

## get TEM
tem <- tapply(X = df[[m1]] - df[[m2]],
INDEX = df[ , index],
FUN = calculate_tem,
n = n)
tem <- tapply(
X = df[[m1]] - df[[m2]],
INDEX = df[ , index],
FUN = calculate_tem,
n = n
)

## Create data.frame
tem <- as.data.frame.table(tem)
Expand Down
4 changes: 0 additions & 4 deletions R/04_calculate_team_tem.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
################################################################################
#
#'
#' Calculate technical error of measurement (TEM) for two or more observers
#'
Expand All @@ -20,8 +18,6 @@
#'
#' @export
#'
#
################################################################################

calculate_team_tem <- function(n, k, m) {

Expand Down
9 changes: 0 additions & 9 deletions R/05_calculate_relative_tem.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
################################################################################
#
#'
#' Calculate relative TEM of measurements by multiple observers.
#'
Expand Down Expand Up @@ -29,8 +27,6 @@
#'
#' @export
#'
#
################################################################################

calculate_relative_tem <- function(tem, mean_value) {
## Calculate relative TEM
Expand All @@ -39,8 +35,3 @@ calculate_relative_tem <- function(tem, mean_value) {
## Return output
return(relative_tem)
}





6 changes: 1 addition & 5 deletions R/06_calculate_total_tem.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
################################################################################
#
#'
#' Calculate the Total TEM given individual intra-observer TEM.
#'
Expand Down Expand Up @@ -33,12 +31,10 @@
#'
#' @export
#'
#
################################################################################

calculate_total_tem <- function(intra, inter) {
## Get total TEM
total_tem <- sqrt((sum(intra ^ 2) / length(intra)) + (inter ^ 2) )
total_tem <- sqrt((sum(intra ^ 2) / length(intra)) + (inter ^ 2))

## Return output
return(total_tem)
Expand Down
4 changes: 0 additions & 4 deletions R/07_calculate_coeff_r.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
################################################################################
#
#'
#' Calculate the coefficient of reliability (R).
#'
Expand Down Expand Up @@ -41,8 +39,6 @@
#'
#' @export
#'
#
################################################################################

calculate_coeff_r <- function(total_tem, sd) {

Expand Down
4 changes: 0 additions & 4 deletions R/08_estimate_bias.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
################################################################################
#
#'
#' Calculate bias of a measurement
#'
Expand Down Expand Up @@ -29,8 +27,6 @@
#'
#' @export
#'
#
################################################################################

estimate_bias <- function(msur, msup, mall) {
## Bias from supervisor
Expand Down
25 changes: 16 additions & 9 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ knitr::opts_chunk$set(
out.width = "100%"
)
```
# anthrocheckr: An Implementation of Anthropometric Measurement Standardisation Tests in R <img src="man/figures/logo.png" width="200" align="right" />
# anthrocheckr: An Implementation of Anthropometric Measurement Standardisation Tests <img src="man/figures/logo.png" width="200" align="right" />

<!-- badges: start -->
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
Expand All @@ -21,31 +21,38 @@ knitr::opts_chunk$set(
[![CRAN](https://img.shields.io/cran/l/anhtrocheckr.svg)](https://CRAN.R-project.org/package=anhtrocheckr)
[![CRAN](http://cranlogs.r-pkg.org/badges/anhtrocheckr)](https://CRAN.R-project.org/package=anhtrocheckr)
[![CRAN](http://cranlogs.r-pkg.org/badges/grand-total/anhtrocheckr)](https://CRAN.R-project.org/package=anhtrocheckr)
[![R build status](https://github.com/nutriverse/anthrocheckr/workflows/R-CMD-check/badge.svg)](https://github.com/nutriverse/anthrocheckr/actions)
[![R-CMD-check](https://github.com/nutriverse/anthrocheckr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/nutriverse/anthrocheckr/actions/workflows/R-CMD-check.yaml)
[![R build status](https://github.com/nutriverse/anthrocheckr/workflows/test-coverage/badge.svg)](https://github.com/nutriverse/anthrocheckr/actions)
[![Codecov test coverage](https://codecov.io/gh/nutriverse/anthrocheckr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/nutriverse/anthrocheckr?branch=main)
[![CodeFactor](https://www.codefactor.io/repository/github/nutriverse/anthrocheckr/badge)](https://www.codefactor.io/repository/github/nutriverse/anthrocheckr)
[![R-CMD-check](https://github.com/nutriverse/anthrocheckr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/nutriverse/anthrocheckr/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

Ensuring the precision and accuracy of measurements is critical when collecting anthropometric data. Anthropometrists are usually tested for precision and accuracy of measurement through standardisation tests performed prior to anthropometric data collection. This package provides functions to calculate inter- and intra-observer technical error of measurement (TEM) to assess precision of measurements.

## Installation
## What does `anthrocheckr` do?

`anthrocheckr` is still in active development and is not available on [CRAN](https://cran.r-project.org/) yet.
## Installation

You can install the development version of `anthrocheckr` from [GitHub](https://github.com/nutriverse/anthrocheckr) with:
`anthrocheckr` is not yet on [CRAN](https://cran.r-project.org) but can be installed from the [nutriverse R universe](https://nutriverse.r-universe.dev) as follows:

```{r install_github, echo = TRUE, eval = FALSE}
if(!require(remotes)) install.packages("remotes")
remotes::install_github("nutriverse/anthrocheckr")
```{r install-r-universe, eval = FALSE}
install.packages(
"anthrocheckr",
repos = c('https://nutriverse.r-universe.dev', 'https://cloud.r-project.org')
)
```

## Usage



## Citation

If you find the `anthrocheckr` package useful please cite using the suggested citation provided by a call to the `citation()` function as follows:

```{r citation}
citation("anthrocheckr")
```

## Community guidelines

Expand Down
Loading

0 comments on commit 8dcfd6c

Please sign in to comment.