diff --git a/.Rbuildignore b/.Rbuildignore index 2d291394..d595115b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,4 @@ +^cran-comments\.md$ ^\.buildignore$ ^appveyor\.yml$ ^.*\.Rproj$ diff --git a/DESCRIPTION b/DESCRIPTION index d6340d40..2ca8a80f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: fgeo.tool -Title: Manipulate ForestGEO Data -Version: 0.0.0.9005 +Title: Import and Manipulate ForestGEO Data +Version: 1.0.0 Authors@R: c(person(given = "Mauro", family = "Lepore", @@ -18,8 +18,7 @@ Authors@R: role = c("cph", "fnd"), email = "ForestGEO@si.edu")) Description: Import and manipulate ForestGEO data - (\url{http://www.forestgeo.si.edu/}) with functions that expect - different classes of ForestGEO data. + (). License: GPL-3 URL: https://github.com/forestgeo/fgeo.tool BugReports: https://github.com/forestgeo/fgeo.tool/issues @@ -40,11 +39,12 @@ Imports: Suggests: covr, knitr, + pingr, + roxygen2, spelling, stringr, - testthat -VignetteBuilder: - knitr + testthat, + tidyr Remotes: forestgeo/fgeo.x@*release Encoding: UTF-8 diff --git a/NAMESPACE b/NAMESPACE index 7dd12e06..f111429b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,6 +8,7 @@ S3method(flag_if,data.frame) S3method(flag_if,default) export("%>%") export("%||%") +export(.data) export(add_col_row) export(add_count) export(add_gxgy) @@ -29,12 +30,13 @@ export(drop_if_na) export(drop_status) export(ends_with) export(enexpr) +export(enexprs) export(enquo) export(enquos) export(ensym) +export(ensyms) export(everything) export(expr) -export(exprs) export(extract_gridsize) export(extract_insensitive) export(extract_plotdim) @@ -104,15 +106,14 @@ importFrom(glue,glue_collapse) importFrom(magrittr,"%>%") importFrom(purrr,quietly) importFrom(rlang,"%||%") -importFrom(rlang,":=") importFrom(rlang,.data) -importFrom(rlang,UQ) -importFrom(rlang,UQS) importFrom(rlang,abort) importFrom(rlang,enexpr) +importFrom(rlang,enexprs) importFrom(rlang,enquo) importFrom(rlang,enquos) importFrom(rlang,ensym) +importFrom(rlang,ensyms) importFrom(rlang,expr) importFrom(rlang,exprs) importFrom(rlang,has_name) diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 00000000..3d907045 --- /dev/null +++ b/NEWS.md @@ -0,0 +1,3 @@ +# fgeo.tool 1.0.0 + +* Initial release. diff --git a/R/imports-reeports.R b/R/aaa-imports-reeports.R similarity index 53% rename from R/imports-reeports.R rename to R/aaa-imports-reeports.R index fbfcc383..fb626dbc 100644 --- a/R/imports-reeports.R +++ b/R/aaa-imports-reeports.R @@ -8,39 +8,8 @@ rlang::`%||%` globalVariables(c(".data", ".")) -# Tidy eval --------------------------------------------------------------- +# dplyr ------------------------------------------------------------------- -#' Tidy eval helpers -#' -#' These functions provide tidy eval-compatible ways to capture -#' symbols (`sym()`, `syms()`, `ensym()`), expressions (`expr()`, -#' `exprs()`, `enexpr()`), and quosures (`quo()`, `quos()`, `enquo()`). -#' To learn more about tidy eval and how to use these tools, read -#' -#' -#' @name tidyeval -#' @keywords internal -#' @aliases quo quos enquo sym syms ensym expr exprs enexpr quo_name enquos -#' @importFrom rlang quo quos enquo sym syms ensym expr exprs enexpr quo_name enquos -#' @export quo quos enquo sym syms ensym expr exprs enexpr quo_name enquos -#' @importFrom rlang UQ UQS .data := -NULL - -# Reexport most commonly used functions from the tidyverse ---------------- - -#' Pipe operator -#' -#' See \code{magrittr::\link[magrittr]{\%>\%}} for details. -#' -#' @name %>% -#' @rdname pipe -#' @keywords internal -#' @export -#' @importFrom magrittr %>% -#' @usage lhs \%>\% rhs -NULL - -# Main verbs #' @importFrom dplyr filter mutate select arrange summarize summarise desc NULL #' @export @@ -72,6 +41,8 @@ dplyr::count #' @export dplyr::add_count +# tidyselect -------------------------------------------------------------- + # Unleash the power of dplyr::select(). See ?tidyselect::select_helpers #' @importFrom tidyselect starts_with ends_with contains matches num_range #' @importFrom tidyselect one_of everything last_col @@ -93,8 +64,9 @@ tidyselect::everything #' @export tidyselect::last_col -# Handle large datasets; print more info than dataframes and nicer -#' @importFrom tibble tibble tribble as_tibble +# tibble ------------------------------------------------------------------ + +#' @importFrom tibble as_tibble tibble tribble NULL #' @export tibble::tibble @@ -103,3 +75,7 @@ tibble::tribble #' @export tibble::as_tibble +# Other ------------------------------------------------------------------- + +# rlang: See utils-tidy-eval.R +# magrittr: See utils-pipe.R diff --git a/R/aaa-utils-pipe.R b/R/aaa-utils-pipe.R new file mode 100644 index 00000000..fb8c8186 --- /dev/null +++ b/R/aaa-utils-pipe.R @@ -0,0 +1,11 @@ +#' Pipe operator +#' +#' See \code{magrittr::\link[magrittr]{\%>\%}} for details. +#' +#' @name %>% +#' @rdname pipe +#' @keywords internal +#' @export +#' @importFrom magrittr %>% +#' @usage lhs \%>\% rhs +NULL diff --git a/R/aaa-utils-tidy-eval.R b/R/aaa-utils-tidy-eval.R new file mode 100644 index 00000000..2ff60624 --- /dev/null +++ b/R/aaa-utils-tidy-eval.R @@ -0,0 +1,45 @@ +#' Tidy eval helpers +#' +#' @description +#' +#' * \code{\link[rlang]{sym}()} creates a symbol from a string and +#' \code{\link[rlang]{syms}()} creates a list of symbols from a +#' character vector. +#' +#' * \code{\link[rlang]{expr}()} and \code{\link[rlang]{quo}()} quote +#' one expression. `quo()` wraps the quoted expression in a quosure. +#' +#' The plural variants [rlang::exprs()] and +#' \code{\link[rlang]{quos}()} return a list of quoted expressions or +#' quosures. +#' +#' * \code{\link[rlang]{enexpr}()} and \code{\link[rlang]{enquo}()} +#' capture the expression supplied as argument by the user of the +#' current function (`enquo()` wraps this expression in a quosure). +#' +#' \code{\link[rlang]{enexprs}()} and \code{\link[rlang]{enquos}()} +#' capture multiple expressions supplied as arguments, including +#' `...`. +#' +#' `exprs()` is not exported to avoid conflicts with `Biobase::exprs()`, +#' therefore one should always use `rlang::exprs()`. +#' +#' To learn more about tidy eval and how to use these tools, visit +#' and the [Metaprogramming +#' section](https://adv-r.hadley.nz/introduction-16.html) of [Advanced +#' R](https://adv-r.hadley.nz). +#' +#' @md +#' @name tidyeval +#' @keywords internal +#' @importFrom rlang quo quos enquo enquos quo_name sym ensym syms +#' ensyms expr exprs enexpr enexprs .data +#' @aliases quo quos enquo enquos quo_name +#' sym ensym syms ensyms +#' expr exprs enexpr enexprs +#' .data +#' @export quo quos enquo enquos quo_name +#' @export sym ensym syms ensyms +#' @export expr enexpr enexprs +#' @export .data +NULL diff --git a/R/utils.R b/R/aaa-utils.R similarity index 100% rename from R/utils.R rename to R/aaa-utils.R diff --git a/R/add_status_tree.R b/R/add_status_tree.R index a1464906..cca2e8d4 100644 --- a/R/add_status_tree.R +++ b/R/add_status_tree.R @@ -1,3 +1,7 @@ +#' @importFrom tibble tribble +#' @export +tibble::tribble + #' Add column `status_tree` based on the status of all stems of each tree. #' #' @template x_fgeo diff --git a/R/add_subquad.R b/R/add_subquad.R index 4ca5611b..9ed188c2 100644 --- a/R/add_subquad.R +++ b/R/add_subquad.R @@ -117,7 +117,7 @@ add_subquad <- function(df, #' @return A modified version of the input. #' #' @examples -#' first_subquad_11 <- tibble::tibble(subquadrat = c("11", "12", "22")) +#' first_subquad_11 <- tibble(subquadrat = c("11", "12", "22")) #' first_subquad_11 #' #' first_subquad_01 <- recode_subquad(first_subquad_11, offset = -1) diff --git a/R/from_var_to_var.R b/R/from_var_to_var.R index 7add0818..e5cfcc41 100644 --- a/R/from_var_to_var.R +++ b/R/from_var_to_var.R @@ -105,7 +105,7 @@ index_to_rowcol <- function(index, gridsize, plotdim) { #' @export gxgy_to_index <- function(gx, gy, gridsize, plotdim) { if (missing(plotdim)) { - plotdim <- guess_plotdim(tibble::tibble(gx = gx, gy = gy)) + plotdim <- guess_plotdim(tibble(gx = gx, gy = gy)) } badgxgy <- (gx < 0 | gy < 0 | gx >= plotdim[1] | gy >= plotdim[2] | @@ -123,7 +123,7 @@ gxgy_to_index <- function(gx, gy, gridsize, plotdim) { #' @export gxgy_to_lxly <- function(gx, gy, gridsize, plotdim) { if (missing(plotdim)) { - plotdim <- guess_plotdim(tibble::tibble(gx, gy)) + plotdim <- guess_plotdim(tibble(gx, gy)) } rc <- gxgy_to_rowcol(gx, gy, gridsize, plotdim) - 1 @@ -147,7 +147,7 @@ gxgy_to_qxqy <- function(gx, gy, gridsize, plotdim) { #' @export gxgy_to_rowcol <- function(gx, gy, gridsize, plotdim) { if (missing(plotdim)) { - plotdim <- guess_plotdim(tibble::tibble(gx, gy)) + plotdim <- guess_plotdim(tibble(gx, gy)) } index <- gxgy_to_index(gx, gy, gridsize, plotdim) @@ -158,7 +158,7 @@ gxgy_to_rowcol <- function(gx, gy, gridsize, plotdim) { #' @export gxgy_to_hectindex <- function(gx, gy, plotdim) { if (missing(plotdim)) { - plotdim <- guess_plotdim(tibble::tibble(gx = gx, gy = gy)) + plotdim <- guess_plotdim(tibble(gx = gx, gy = gy)) } if (at_or_beyond_edge(gx, gy, plotdim)) { diff --git a/R/nms_manipulate_names.R b/R/nms_manipulate_names.R index 3d4391bf..f6db0927 100644 --- a/R/nms_manipulate_names.R +++ b/R/nms_manipulate_names.R @@ -56,7 +56,7 @@ nms_try_rename <- function(x, want, try) { #' * `nms_restore()` Returns the object `x` with original (restored) names. #' #' @examples -#' cns <- tibble::tibble(CensusID = 1, status = "A") +#' cns <- tibble(CensusID = 1, status = "A") #' original <- cns #' original #' diff --git a/R/read_fgeo.R b/R/read_fgeo.R index df4d00d4..3226e88a 100644 --- a/R/read_fgeo.R +++ b/R/read_fgeo.R @@ -44,7 +44,7 @@ read_delim_ <- function(delim, file, col_types, na, ...) { #' #' @seealso [readr::read_delim()], [type_vft()], [type_taxa()]. #' -#' @return A dataframe (or tibble). +#' @return A dataframe (or [tibble][tibble::tibble-package]). #' #' @examples #' library(fgeo.x) diff --git a/R/type_ensure.R b/R/type_ensure.R index 7ae7c60b..3c04a24e 100644 --- a/R/type_ensure.R +++ b/R/type_ensure.R @@ -10,7 +10,7 @@ #' of type `type`. #' #' @examples -#' dfm <- tibble::tibble( +#' dfm <- tibble( #' w = c(NA, 1, 2), #' x = 1:3, #' y = as.character(1:3), diff --git a/cran-comments.md b/cran-comments.md new file mode 100644 index 00000000..7b9ee193 --- /dev/null +++ b/cran-comments.md @@ -0,0 +1,38 @@ +## Test environments + +* local windows 10 x64, R 3.5.2 +* ubuntu 14.04 (on travis-ci), R 3.5.1 +* win-builder (devel and release) + +## R CMD check results + +0 errors | 0 warnings | 3 notes +Platform: Ubuntu Linux 16.04 LTS, R-release, GCC +Build ID: fgeo.tool_1.0.0.tar.gz-0f72e41e51a84fcabc6c05c80881c26d +* New submission +* Unknown, possibly mis-spelled, fields in DESCRIPTION: ‘Remotes’ +* Strong dependencies not in mainstream repositories: fgeo.x + +0 errors | 3 warnings | 0 notes +Platform: Fedora Linux, R-devel, clang, gfortran +Build ID: fgeo.tool_1.0.0.tar.gz-0714fa14002648d29d3d6799b2295e7f +* New submission +* Unknown, possibly mis-spelled, fields in DESCRIPTION: ‘Remotes’ +* Strong dependencies not in mainstream repositories: fgeo.x + +0 errors | 3 warnings | 0 notes +Platform: Windows Server 2008 R2 SP1, R-devel, 32/64 bit +Build ID: fgeo.tool_1.0.0.tar.gz-f58d4077e55b47c9a6c7cf738664c1f4 +* New submission +* Unknown, possibly mis-spelled, fields in DESCRIPTION: ‘Remotes’ +* Strong dependencies not in mainstream repositories: fgeo.x + +0 errors | 3 warnings | 0 notes +using R Under development (unstable) (2019-01-07 r75958) +* New submission +* Unknown, possibly mis-spelled, fields in DESCRIPTION: 'Remotes' +* Strong dependencies not in mainstream repositories: fgeo.x + +## Downstream dependencies + +There are currently no downstream dependencies for this package. diff --git a/docs/CODE_OF_CONDUCT.html b/docs/CODE_OF_CONDUCT.html index b050f0e2..415345df 100644 --- a/docs/CODE_OF_CONDUCT.html +++ b/docs/CODE_OF_CONDUCT.html @@ -60,7 +60,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -74,6 +74,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index 55d11ff0..a84fdb4a 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -60,7 +60,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -74,6 +74,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/ISSUE_TEMPLATE.html b/docs/ISSUE_TEMPLATE.html index e9666b3f..eefa70b7 100644 --- a/docs/ISSUE_TEMPLATE.html +++ b/docs/ISSUE_TEMPLATE.html @@ -60,7 +60,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -74,6 +74,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 1bd4bae2..568e49ba 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -60,7 +60,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -74,6 +74,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/SUPPORT.html b/docs/SUPPORT.html index e3b922ca..0e6caa38 100644 --- a/docs/SUPPORT.html +++ b/docs/SUPPORT.html @@ -60,7 +60,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -74,6 +74,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/authors.html b/docs/authors.html index 5091816f..af423b1c 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -60,7 +60,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -74,6 +74,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/index.html b/docs/index.html index 8ce4f61c..aeccdf65 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,14 +5,14 @@ -Manipulate ForestGEO Data • fgeo.tool +Import and Manipulate ForestGEO Data • fgeo.tool - + + (<http://www.forestgeo.si.edu/>) with functions that expect different + classes of ForestGEO data."> + + + + + + + +Changelog • fgeo.tool + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    +

    +fgeo.tool 1.0.0

    +
      +
    • Initial release.
    • +
    +
    +
    + + + +
    + + +
    + + + + + + diff --git a/docs/reference/add_status_tree.html b/docs/reference/add_status_tree.html index 361b9503..8d40bcae 100644 --- a/docs/reference/add_status_tree.html +++ b/docs/reference/add_status_tree.html @@ -63,7 +63,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -77,6 +77,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -154,7 +157,7 @@

    See a

    Examples

    -
    stem <- tribble( +
    stem <- tribble( ~CensusID, ~treeID, ~stemID, ~status, 1, 1, 1, "A", 1, 1, 2, "D", diff --git a/docs/reference/add_subquad.html b/docs/reference/add_subquad.html index 33b8944c..70bf041d 100644 --- a/docs/reference/add_subquad.html +++ b/docs/reference/add_subquad.html @@ -63,7 +63,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -77,6 +77,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -169,7 +172,7 @@

    See a

    Examples

    -
    vft <- tribble( +
    vft <- tribble( ~QX, ~QY, 17.9, 0, 4.1, 15, diff --git a/docs/reference/add_var.html b/docs/reference/add_var.html index ad52043a..6f219b5d 100644 --- a/docs/reference/add_var.html +++ b/docs/reference/add_var.html @@ -68,7 +68,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -82,6 +82,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -193,7 +196,7 @@

    See a

    Examples

    -
    x <- tribble( +
    x <- tribble( ~gx, ~gy, 0, 0, 50, 25, @@ -266,7 +269,7 @@

    Examp #> 4 1000 500 NA NA

    # From `quadrat` or `QuadratName` -------------------------------------- -x <- tribble( +x <- tribble( ~QuadratName, "0001", "0011", @@ -311,7 +314,7 @@

    Examp library(tidyr) library(stringr) - vft <- tibble(QuadratName = c("0001", "0011")) + vft <- tibble(QuadratName = c("0001", "0011")) vft separate( diff --git a/docs/reference/check_crucial_names.html b/docs/reference/check_crucial_names.html index d422e24a..b78c7f6f 100644 --- a/docs/reference/check_crucial_names.html +++ b/docs/reference/check_crucial_names.html @@ -63,7 +63,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0

    @@ -77,6 +77,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/drop_if_na.html b/docs/reference/drop_if_na.html index 879b0e27..90db18cd 100644 --- a/docs/reference/drop_if_na.html +++ b/docs/reference/drop_if_na.html @@ -63,7 +63,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -77,6 +77,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/extract_from_habitat.html b/docs/reference/extract_from_habitat.html index ed2559a6..c9f5809c 100644 --- a/docs/reference/extract_from_habitat.html +++ b/docs/reference/extract_from_habitat.html @@ -63,7 +63,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -77,6 +77,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/extract_insensitive.html b/docs/reference/extract_insensitive.html index e65cc680..0a32ca87 100644 --- a/docs/reference/extract_insensitive.html +++ b/docs/reference/extract_insensitive.html @@ -64,7 +64,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -78,6 +78,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/fgeo.tool-package.html b/docs/reference/fgeo.tool-package.html index a230fc5e..771c09fa 100644 --- a/docs/reference/fgeo.tool-package.html +++ b/docs/reference/fgeo.tool-package.html @@ -6,7 +6,7 @@ -fgeo.tool: Manipulate ForestGEO Data — fgeo.tool-package • fgeo.tool +fgeo.tool: Import and Manipulate ForestGEO Data — fgeo.tool-package • fgeo.tool @@ -30,11 +30,11 @@ - + + (&lt;http://www.forestgeo.si.edu/&gt;) with functions that expect different + classes of ForestGEO data." /> @@ -65,7 +65,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -79,6 +79,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -110,7 +113,7 @@
    @@ -118,8 +121,8 @@

    fgeo.tool: Manipulate ForestGEO Data

    Import and manipulate ForestGEO data - (http://www.forestgeo.si.edu/) with functions that expect - different classes of ForestGEO data.

    + (<http://www.forestgeo.si.edu/>) with functions that expect different + classes of ForestGEO data.

    diff --git a/docs/reference/fgeo_elevation.html b/docs/reference/fgeo_elevation.html index 2bf81de8..90934f10 100644 --- a/docs/reference/fgeo_elevation.html +++ b/docs/reference/fgeo_elevation.html @@ -65,7 +65,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -79,6 +79,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/flag_if.html b/docs/reference/flag_if.html index d4eea606..95f46b0e 100644 --- a/docs/reference/flag_if.html +++ b/docs/reference/flag_if.html @@ -65,7 +65,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -79,6 +79,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -151,7 +154,7 @@

    Arg condition

    A condition function (e.g. stop(), warning(), -rlang::inform()).

    +rlang::inform()).

    msg diff --git a/docs/reference/flag_if_group.html b/docs/reference/flag_if_group.html index 3505fced..a689a095 100644 --- a/docs/reference/flag_if_group.html +++ b/docs/reference/flag_if_group.html @@ -64,7 +64,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -78,6 +78,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -142,7 +145,7 @@

    Arg condition -

    A condition function, e.g. rlang::inform() or +

    A condition function, e.g. rlang::inform() or base::stop().

    @@ -171,7 +174,7 @@

    See a

    Examples

    -
    tree <- tibble(CensusID = c(1, 2), treeID = c(1, 2)) +
    tree <- tibble(CensusID = c(1, 2), treeID = c(1, 2)) detect_if_group(tree, "treeID", is_multiple)
    #> [1] TRUE
    flag_if_group(tree, "treeID", is_multiple)
    #> Warning: treeID: Flagged values were detected.
    by_censusid <- group_by(tree, CensusID) detect_if_group(by_censusid, "treeID", is_multiple)
    #> [1] FALSE
    flag_if_group(by_censusid, "treeID", is_multiple)
    diff --git a/docs/reference/from_var_to_var.html b/docs/reference/from_var_to_var.html index 2521c410..ff7ab846 100644 --- a/docs/reference/from_var_to_var.html +++ b/docs/reference/from_var_to_var.html @@ -69,7 +69,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -83,6 +83,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/guess_plotdim.html b/docs/reference/guess_plotdim.html index 9911935b..aa880b30 100644 --- a/docs/reference/guess_plotdim.html +++ b/docs/reference/guess_plotdim.html @@ -63,7 +63,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -77,6 +77,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/index.html b/docs/reference/index.html index 34057f18..2bfeccd7 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -60,7 +60,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -74,6 +74,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/is_multiple.html b/docs/reference/is_multiple.html index 491d5427..acbd77ce 100644 --- a/docs/reference/is_multiple.html +++ b/docs/reference/is_multiple.html @@ -64,7 +64,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -78,6 +78,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/nms_try_rename.html b/docs/reference/nms_try_rename.html index d2385269..21ad938c 100644 --- a/docs/reference/nms_try_rename.html +++ b/docs/reference/nms_try_rename.html @@ -64,7 +64,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -78,6 +78,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/pick_drop.html b/docs/reference/pick_drop.html index 0efd7130..a73bef15 100644 --- a/docs/reference/pick_drop.html +++ b/docs/reference/pick_drop.html @@ -68,7 +68,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -82,6 +82,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -177,7 +180,7 @@

    See a

    Examples

    -
    census <- tribble( +
    census <- tribble( ~dbh, ~status, 0, "A", 50, "A", @@ -294,7 +297,7 @@

    Examp #> 1 150 A #> 2 NA M

    # Also works with ViewFullTables -vft <- tribble( +vft <- tribble( ~DBH, ~Status, 0, "alive", 50, "alive", diff --git a/docs/reference/pick_main_stem.html b/docs/reference/pick_main_stem.html index a88a85d8..3dd55f8e 100644 --- a/docs/reference/pick_main_stem.html +++ b/docs/reference/pick_main_stem.html @@ -68,7 +68,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -82,6 +82,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -188,7 +191,7 @@

    Examp
    # One `treeID` with multiple stems. # `stemID == 1.1` has two measurements (due to buttresses). # `stemID == 1.2` has a single measurement. -census <- tribble( +census <- tribble( ~sp, ~treeID, ~stemID, ~hom, ~dbh, ~CensusID, "sp1", "1", "1.1", 140, 40, 1, # main stemID (max `hom`) "sp1", "1", "1.1", 130, 60, 1, diff --git a/docs/reference/pipe.html b/docs/reference/pipe.html index f03bfdf7..b3e24972 100644 --- a/docs/reference/pipe.html +++ b/docs/reference/pipe.html @@ -63,7 +63,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -77,6 +77,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -109,7 +112,7 @@
    diff --git a/docs/reference/read_vft.html b/docs/reference/read_vft.html index 76904dd6..a583d51d 100644 --- a/docs/reference/read_vft.html +++ b/docs/reference/read_vft.html @@ -66,7 +66,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -80,6 +80,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -164,7 +167,7 @@

    Arg

    Value

    -

    A dataframe (or tibble).

    +

    A dataframe (or tibble).

    Acknowledgments

    diff --git a/docs/reference/recode_subquad.html b/docs/reference/recode_subquad.html index 89ebcd80..98dcbaea 100644 --- a/docs/reference/recode_subquad.html +++ b/docs/reference/recode_subquad.html @@ -63,7 +63,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0

    @@ -77,6 +77,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -147,7 +150,7 @@

    Value

    Examples

    -
    first_subquad_11 <- tibble::tibble(subquadrat = c("11", "12", "22")) +
    first_subquad_11 <- tibble(subquadrat = c("11", "12", "22")) first_subquad_11
    #> # A tibble: 3 x 1 #> subquadrat #> <chr> diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index b8c1bf90..0daa50be 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -39,7 +39,7 @@ - + @@ -73,7 +73,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -87,6 +87,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -119,7 +122,7 @@
    @@ -130,9 +133,9 @@

    Objects exported from other packages

    dplyr

    filter, mutate, select, arrange, summarize, summarise, group_by, ungroup, count, add_count

    -
    rlang

    %||%

    +
    rlang

    %||%

    -
    tibble

    tibble, tribble, as_tibble

    +
    tibble

    tibble, tribble, as_tibble, tribble

    tidyselect

    starts_with, ends_with, contains, matches, num_range, one_of, everything, last_col

    diff --git a/docs/reference/rename_matches.html b/docs/reference/rename_matches.html index 6d6b0d4f..be4ee685 100644 --- a/docs/reference/rename_matches.html +++ b/docs/reference/rename_matches.html @@ -63,7 +63,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -77,6 +77,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/sanitize_vft.html b/docs/reference/sanitize_vft.html index 291fb6a2..681283e9 100644 --- a/docs/reference/sanitize_vft.html +++ b/docs/reference/sanitize_vft.html @@ -69,7 +69,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -83,6 +83,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/docs/reference/tidyeval.html b/docs/reference/tidyeval.html index 9159112a..94bc024c 100644 --- a/docs/reference/tidyeval.html +++ b/docs/reference/tidyeval.html @@ -32,11 +32,27 @@ - + + + @@ -67,7 +83,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0 @@ -81,6 +97,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -113,17 +132,33 @@
    -

    These functions provide tidy eval-compatible ways to capture -symbols (sym(), syms(), ensym()), expressions (expr(), -exprs(), enexpr()), and quosures (quo(), quos(), enquo()). -To learn more about tidy eval and how to use these tools, read -http://rlang.tidyverse.org/articles/tidy-evaluation.html

    +
      +
    • sym() creates a symbol from a string and +syms() creates a list of symbols from a +character vector.

    • +
    • expr() and quo() quote +one expression. quo() wraps the quoted expression in a quosure.

      +

      The plural variants rlang::exprs() and +quos() return a list of quoted expressions or +quosures.

    • +
    • enexpr() and enquo() +capture the expression supplied as argument by the user of the +current function (enquo() wraps this expression in a quosure).

      +

      enexprs() and enquos() +capture multiple expressions supplied as arguments, including +....

    • +
    + +

    exprs() is not exported to avoid conflicts with Biobase::exprs(), +therefore one should always use rlang::exprs().

    +

    To learn more about tidy eval and how to use these tools, visit +http://rlang.r-lib.org and the Metaprogramming section of Advanced R.

    diff --git a/docs/reference/type_ensure.html b/docs/reference/type_ensure.html index bb15e8bf..8dad31a3 100644 --- a/docs/reference/type_ensure.html +++ b/docs/reference/type_ensure.html @@ -63,7 +63,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -77,6 +77,9 @@
  • Reference +
  • +
  • + Changelog
  • @@ -155,7 +158,7 @@

    See a

    Examples

    -
    dfm <- tibble::tibble( +
    dfm <- tibble( w = c(NA, 1, 2), x = 1:3, y = as.character(1:3), diff --git a/docs/reference/type_vft.html b/docs/reference/type_vft.html index 70cfa631..68135d6b 100644 --- a/docs/reference/type_vft.html +++ b/docs/reference/type_vft.html @@ -77,7 +77,7 @@ fgeo.tool - 0.0.0.9005 + 1.0.0
    @@ -91,6 +91,9 @@
  • Reference +
  • +
  • + Changelog
  • diff --git a/inst/WORDLIST b/inst/WORDLIST index 17d99626..9c535985 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -6,29 +6,24 @@ CTFS edu Esufali eval -extdata fgeo forestgeo ForestGEO -ForestGEO's ForestgGEO's funder -gl gridsize gz http -https Jafferjee Kenfack lifecycle -lst +Metaprogramming nms plotname -qkX quadrat quadrat's +quosure quosures -Rdata Recode recognised Shameema diff --git a/man/fgeo.tool-package.Rd b/man/fgeo.tool-package.Rd index 02b11824..164495e3 100644 --- a/man/fgeo.tool-package.Rd +++ b/man/fgeo.tool-package.Rd @@ -4,11 +4,11 @@ \name{fgeo.tool-package} \alias{fgeo.tool} \alias{fgeo.tool-package} -\title{fgeo.tool: Manipulate ForestGEO Data} +\title{fgeo.tool: Import and Manipulate ForestGEO Data} \description{ Import and manipulate ForestGEO data - (\url{http://www.forestgeo.si.edu/}) with functions that expect - different classes of ForestGEO data. + () with functions that expect different + classes of ForestGEO data. } \seealso{ Useful links: diff --git a/man/pipe.Rd b/man/pipe.Rd index bc5a2e98..b290cf00 100644 --- a/man/pipe.Rd +++ b/man/pipe.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/imports-reeports.R +% Please edit documentation in R/aaa-utils-pipe.R \name{\%>\%} \alias{\%>\%} \title{Pipe operator} diff --git a/man/read_vft.Rd b/man/read_vft.Rd index fe12a870..f0814537 100644 --- a/man/read_vft.Rd +++ b/man/read_vft.Rd @@ -34,7 +34,7 @@ option to \code{character()} to indicate no missing values.} \item{...}{Other arguments passed to \code{\link[readr:read_delim]{readr::read_delim()}}.} } \value{ -A dataframe (or tibble). +A dataframe (or \link[tibble:tibble-package]{tibble}). } \description{ These functions help you read text files containing ViewFullTable and diff --git a/man/recode_subquad.Rd b/man/recode_subquad.Rd index 8d8a7229..e928bb8c 100644 --- a/man/recode_subquad.Rd +++ b/man/recode_subquad.Rd @@ -25,7 +25,7 @@ A modified version of the input. Recode subquadrat. } \examples{ -first_subquad_11 <- tibble::tibble(subquadrat = c("11", "12", "22")) +first_subquad_11 <- tibble(subquadrat = c("11", "12", "22")) first_subquad_11 first_subquad_01 <- recode_subquad(first_subquad_11, offset = -1) diff --git a/man/reexports.Rd b/man/reexports.Rd index 46f997f6..f25896ae 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/imports-reeports.R +% Please edit documentation in R/aaa-imports-reeports.R, R/add_status_tree.R \docType{import} \name{reexports} \alias{reexports} @@ -36,7 +36,7 @@ below to see their documentation. \item{rlang}{\code{\link[rlang]{\%||\%}}} - \item{tibble}{\code{\link[tibble]{tibble}}, \code{\link[tibble]{tribble}}, \code{\link[tibble]{as_tibble}}} + \item{tibble}{\code{\link[tibble]{tibble}}, \code{\link[tibble]{tribble}}, \code{\link[tibble]{as_tibble}}, \code{\link[tibble]{tribble}}} \item{tidyselect}{\code{\link[tidyselect]{starts_with}}, \code{\link[tidyselect]{ends_with}}, \code{\link[tidyselect]{contains}}, \code{\link[tidyselect]{matches}}, \code{\link[tidyselect]{num_range}}, \code{\link[tidyselect]{one_of}}, \code{\link[tidyselect]{everything}}, \code{\link[tidyselect]{last_col}}} }} diff --git a/man/tidyeval.Rd b/man/tidyeval.Rd index 96357877..d694fe19 100644 --- a/man/tidyeval.Rd +++ b/man/tidyeval.Rd @@ -1,24 +1,46 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/imports-reeports.R +% Please edit documentation in R/aaa-utils-tidy-eval.R \name{tidyeval} \alias{tidyeval} \alias{quo} \alias{quos} \alias{enquo} +\alias{enquos} +\alias{quo_name} \alias{sym} -\alias{syms} \alias{ensym} +\alias{syms} +\alias{ensyms} \alias{expr} \alias{exprs} \alias{enexpr} -\alias{quo_name} -\alias{enquos} +\alias{enexprs} +\alias{.data} \title{Tidy eval helpers} \description{ -These functions provide tidy eval-compatible ways to capture -symbols (\code{sym()}, \code{syms()}, \code{ensym()}), expressions (\code{expr()}, -\code{exprs()}, \code{enexpr()}), and quosures (\code{quo()}, \code{quos()}, \code{enquo()}). -To learn more about tidy eval and how to use these tools, read -\url{http://rlang.tidyverse.org/articles/tidy-evaluation.html} +\itemize{ +\item \code{\link[rlang]{sym}()} creates a symbol from a string and +\code{\link[rlang]{syms}()} creates a list of symbols from a +character vector. +\item \code{\link[rlang]{expr}()} and \code{\link[rlang]{quo}()} quote +one expression. \code{quo()} wraps the quoted expression in a quosure. + +The plural variants \code{\link[rlang:exprs]{rlang::exprs()}} and +\code{\link[rlang]{quos}()} return a list of quoted expressions or +quosures. +\item \code{\link[rlang]{enexpr}()} and \code{\link[rlang]{enquo}()} +capture the expression supplied as argument by the user of the +current function (\code{enquo()} wraps this expression in a quosure). + +\code{\link[rlang]{enexprs}()} and \code{\link[rlang]{enquos}()} +capture multiple expressions supplied as arguments, including +\code{...}. +} + +\code{exprs()} is not exported to avoid conflicts with \code{Biobase::exprs()}, +therefore one should always use \code{rlang::exprs()}. + +To learn more about tidy eval and how to use these tools, visit +\url{http://rlang.r-lib.org} and the \href{https://adv-r.hadley.nz/introduction-16.html}{Metaprogramming section} of \href{https://adv-r.hadley.nz}{Advanced R}. } \keyword{internal} diff --git a/man/type_ensure.Rd b/man/type_ensure.Rd index f60d8127..af33655e 100644 --- a/man/type_ensure.Rd +++ b/man/type_ensure.Rd @@ -21,7 +21,7 @@ of type \code{type}. Ensure the specific columns of a dataframe have a particular type. } \examples{ -dfm <- tibble::tibble( +dfm <- tibble( w = c(NA, 1, 2), x = 1:3, y = as.character(1:3), diff --git a/tests/testthat/test-add_status_tree.R b/tests/testthat/test-add_status_tree.R index bf3c1a95..169c8fe1 100644 --- a/tests/testthat/test-add_status_tree.R +++ b/tests/testthat/test-add_status_tree.R @@ -1,6 +1,6 @@ context("add_status_tree") -stem <- tibble::tribble( +stem <- tribble( ~CensusID, ~treeID, ~stemID, ~status, 1, 1, 1, "A", 1, 1, 2, "D", @@ -101,15 +101,6 @@ test_that("warns if the status is invalid", { expect_silent(add_status_tree(.df, "dead", "alive")) }) - - - - - - - - - test_that("handles names as in viewfull (vf) and census (cns) tables", { vf <- tibble::tribble( ~CensusID, ~TreeID, ~Status, diff --git a/tests/testthat/test-read_fgeo.R b/tests/testthat/test-read_fgeo.R index 26a0a51d..850df3b3 100644 --- a/tests/testthat/test-read_fgeo.R +++ b/tests/testthat/test-read_fgeo.R @@ -4,10 +4,7 @@ test_that("read_vft fails gracefully if data has missing columns", { comma <- tempfile() write.csv(fgeo.x::vft_4quad[-1], comma) - expect_error( - read_vft(comma), - "Can't find.*DBHID" - ) + expect_error(read_vft(comma), "DBHID") }) test_that("read_vft guesses tab or comma separated file", { @@ -38,6 +35,7 @@ test_that("read_vft guesses tab or comma separated file", { context("read_taxa") test_that("read_taxa can read an online file", { + skip_on_cran() skip_if_not_installed("pingr") skip_if(!pingr::is_online(), "Not online.") diff --git a/tests/testthat/test-rename_matches.R b/tests/testthat/test-rename_matches.R index 7252162c..aab15731 100644 --- a/tests/testthat/test-rename_matches.R +++ b/tests/testthat/test-rename_matches.R @@ -17,10 +17,10 @@ describe("detect_insensitive()", { expect_equal(detect_insensitive(x, y), c(TRUE, FALSE)) }) - it("fails with really bad input and with informative messages", { - expect_error(detect_insensitive(1), "is not TRUE") + it("fails gracefully", { + expect_error(detect_insensitive(1, "a"), "is not TRUE") expect_error(extract_insensitive(1), "argument.*is missing") - expect_error(detect_insensitive(data.frame(1)), "is not TRUE") + expect_error(detect_insensitive(data.frame(1), "a"), "is not TRUE") expect_error(extract_insensitive(data.frame(1)), "argument.*is missing") }) })