Skip to content

Commit

Permalink
version release
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfeclw committed Sep 1, 2022
1 parent 8092990 commit dbb32b0
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 37 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
^spirobankR\.Rproj$
^\.Rproj\.user$
spiro_trash
^LICENSE\.md$
21 changes: 12 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
Package: spirobankR
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Title: Read and Analyze Spirobank Data
Version: 1.0.0
Authors@R:
person(given = "First",
family = "Last",
person(given = "Chris",
family = "Wolfe",
role = c("aut", "cre"),
email = "first.last@example.com",
email = "wolfe.christopherlee@gmail.com",
comment = c(ORCID = "YOUR-ORCID-ID"))
Description: What the package does (one paragraph).
License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a
license
Description: spirobanR includes funtions to read and summarize PDF and SQL Spirobank data.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
Expand All @@ -20,4 +19,8 @@ Imports:
DBI,
dplyr,
tidyr,
purrr
purrr,
lubridate,
tibble,
pdftools,
stringr
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2022
COPYRIGHT HOLDER: spirobankR authors
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2022 spirobankR authors

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.
2 changes: 1 addition & 1 deletion R/get_summary_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#'
#' @param df a data frame created by `read_spiro_sql()` or `read_spiro_pdf().`
#' @param grp_vars character; string of column names to used to calculate maximum values by group (i.e. 'id', 'spiro_test', etc.).
#' See \code{\link[dplyr]{dplyr::group_by()}}.
#' See \link[dplyr]{group_by}.
#' @param sum_fun character; summary function to be applied. Must be one of c("max," "mean," "sd," "median," "min").
#' @param basic_parameters logical; if TRUE, the default, only values for the following parameters are returned:
#' - FEV1
Expand Down
31 changes: 17 additions & 14 deletions R/read_ispiro_pdf.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

#' Read iSpirometry PDF Export
#' Read iSpirometry PDF Files
#'
#'`read_ispirometry_pdf()` reads exported PDF files from the iSpirometry phone app. Text is extracted using
#'the Tesseract OCR engine ([Tesseract](https://cran.r-project.org/web/packages/tesseract/vignettes/intro.html))
#'`read_ispirometry_pdf()` reads exported PDF files from the iSpirometry phone app. Text is
#'extracted using the Tesseract OCR engine ([Tesseract](https://cran.r-project.org/web/packages/tesseract/vignettes/intro.html))
#'
#' @param pdf character; path of of iSpirometry PDF export.
#' @param pages numeric; vector of page numbers to extract. If NULL, the default, all pages are extracted.
Expand All @@ -15,26 +15,29 @@
#' data collection by individual patents. Default is NULL.
#' @param sample_id user defined string to denote sample ID. If assigned, a
#' value must also be supplied to `sample_col`. Default is NULL.
#' @param test_threshold numeric; allows a user to partition Spirobank trials into discrete tests according to a user defined
#' threshold value (seconds). If the time difference between the last trial and and a new trial exceeds the threshold value,
#' the current trial is designated as belonging to a new test. For example, the threshold value is set at 600 seconds (10 minutes)
#' and a patient performs 6 trials. The first 3 trials are done consecutively within 10 minutes. The fourth trial occurs
#' about one hour after the third. The fifth and sixth trial are completed within 10 minutes of the fourth trial.
#' These six trials represent two separate testing sessions according the user defined threshold. Spirobank test number is indicated
#' under the column `spiro_test.`
#' @param test_threshold numeric; allows a user to partition Spirobank trials into discrete
#' tests according to a user defined threshold value (seconds). If the time difference
#' between the last trial and and a new trial exceeds the threshold value, the current
#' trial is designated as belonging to a new test. For example, the threshold value is
#' set at 600 seconds (10 minutes) and a patient performs 6 trials. The first 3 trials are
#' done consecutively within 10 minutes. The fourth trial occurs about one hour after the
#' third. The fifth and sixth trial are completed within 10 minutes of the fourth trial. These
#' six trials represent two separate testing sessions according the user defined threshold.
#' Spirobank test number is indicated under the column `spiro_test.`
#'#'
#' @export
#'
#' @examples
#'
#' \dontrun{
#' read_ispiro_pdf(pdf, pages = NULL, tzone = 'America/New_York', participant_id = NULL, sample_col = NULL,
#' sample_id = NULL, test_threshold = NULL)
#' read_ispiro_pdf(pdf, pages = NULL, tzone = 'America/New_York', participant_id = NULL,
#' sample_col = NULL, sample_id = NULL, test_threshold = NULL)
#' }
#'
#'
read_ispirometry_pdf <- function(pdf, pages = NULL, tzone = 'America/New_York', participant_id = NULL, sample_col = NULL,
sample_id = NULL, test_threshold = NULL) {
read_ispirometry_pdf <- function(pdf, pages = NULL, tzone = 'America/New_York',
participant_id = NULL,sample_col = NULL, sample_id = NULL,
test_threshold = NULL) {

if(sum(!is.null(sample_col), !is.null(sample_id)) == 1) {
stop(' Both `sample_col` and `sample_id` must have values.', call. = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion man/get_summary_values.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 14 additions & 12 deletions man/read_ispirometry_pdf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dbb32b0

Please sign in to comment.