Skip to content

Commit

Permalink
Release (#142)
Browse files Browse the repository at this point in the history
* Address devtools::release()
* Add infrastructure
* Suggest pingr
* Suggest tidyr
* Refresh NAMESPACE
* Address release checks on remote servers
* Polish exports
  • Loading branch information
maurolepore authored Jan 9, 2019
1 parent c760f96 commit c1490cb
Show file tree
Hide file tree
Showing 61 changed files with 539 additions and 170 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
^cran-comments\.md$
^\.buildignore$
^appveyor\.yml$
^.*\.Rproj$
Expand Down
14 changes: 7 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -18,8 +18,7 @@ Authors@R:
role = c("cph", "fnd"),
email = "[email protected]"))
Description: Import and manipulate ForestGEO data
(\url{http://www.forestgeo.si.edu/}) with functions that expect
different classes of ForestGEO data.
(<http://www.forestgeo.si.edu/>).
License: GPL-3
URL: https://github.com/forestgeo/fgeo.tool
BugReports: https://github.com/forestgeo/fgeo.tool/issues
Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# fgeo.tool 1.0.0

* Initial release.
44 changes: 10 additions & 34 deletions R/imports-reeports.R → R/aaa-imports-reeports.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#' <http://rlang.tidyverse.org/articles/tidy-evaluation.html>
#'
#' @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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -103,3 +75,7 @@ tibble::tribble
#' @export
tibble::as_tibble

# Other -------------------------------------------------------------------

# rlang: See utils-tidy-eval.R
# magrittr: See utils-pipe.R
11 changes: 11 additions & 0 deletions R/aaa-utils-pipe.R
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions R/aaa-utils-tidy-eval.R
Original file line number Diff line number Diff line change
@@ -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
#' <http://rlang.r-lib.org> 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
File renamed without changes.
4 changes: 4 additions & 0 deletions R/add_status_tree.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/add_subquad.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions R/from_var_to_var.R
Original file line number Diff line number Diff line change
Expand Up @@ -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] |
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion R/nms_manipulate_names.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#'
Expand Down
2 changes: 1 addition & 1 deletion R/read_fgeo.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/type_ensure.R
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
38 changes: 38 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 4 additions & 1 deletion docs/CODE_OF_CONDUCT.html

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

5 changes: 4 additions & 1 deletion docs/CONTRIBUTING.html

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

5 changes: 4 additions & 1 deletion docs/ISSUE_TEMPLATE.html

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

Loading

0 comments on commit c1490cb

Please sign in to comment.