Skip to content

Commit

Permalink
Release 1.1.1 (#70)
Browse files Browse the repository at this point in the history
* Suggest not import fgeo.x
* Remove has_table_names
  • Loading branch information
maurolepore authored Jan 29, 2019
1 parent 9322bb6 commit 5163b32
Show file tree
Hide file tree
Showing 22 changed files with 76 additions and 51 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: fgeo.analyze
Title: Analyze ForestGEO Data
Version: 1.1.0
Version: 1.1.1
Authors@R:
c(person(given = "Mauro",
family = "Lepore",
Expand Down Expand Up @@ -55,7 +55,6 @@ Depends:
Imports:
dplyr,
fgeo.tool,
fgeo.x,
glue,
graphics,
grDevices,
Expand All @@ -70,6 +69,7 @@ Imports:
withr
Suggests:
covr,
fgeo.x,
ggplot2,
knitr,
measurements,
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export("%>%")
export(abundance)
export(abundance_byyr)
export(as_tibble)
export(assert_is_installed)
export(basal_area)
export(basal_area_byyr)
export(fgeo_habitat)
Expand All @@ -35,6 +36,7 @@ importFrom(dplyr,mutate)
importFrom(dplyr,select)
importFrom(dplyr,summarize)
importFrom(dplyr,ungroup)
importFrom(fgeo.tool,assert_is_installed)
importFrom(fgeo.tool,check_crucial_names)
importFrom(fgeo.tool,is_duplicated)
importFrom(fgeo.tool,is_multiple)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

* Work in progress.

# fgeo.analyze 1.1.1 (GitHub release)

* fgeo.x no longer is imported but suggested.

# fgeo.analyze 1.1.0 (GitHub release)

* Import fgeo packages via `Additional_repositories` served at <https://forestgeo.github.io/drat/>
Expand Down
1 change: 1 addition & 0 deletions R/abund_index.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#' is a rowname.
#'
#' @examples
#' assert_is_installed("fgeo.x")
#' abund_index(fgeo.x::tree6, plotdim = c(1000, 500), gridsize = 20)
#' @family functions for abundance and basal area
#' @noRd
Expand Down
1 change: 1 addition & 0 deletions R/abundance.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#' abundance(stem)
#' \dontrun{
#' # Similar but more realistic
#' assert_is_installed("fgeo.x")
#' stem <- fgeo.x::download_data("luquillo_stem5_random")
#'
#' abundance(stem)
Expand Down
1 change: 1 addition & 0 deletions R/add_cluster.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' argument `k` to [stats::cutree()]).
#'
#' @examples
#' assert_is_installed("fgeo.x")
#' elev_ls <- fgeo.x::elevation
#' topo <- fgeo_topography(elev_ls, gridsize = 20)
#' add_cluster(topo, n = 4)
Expand Down
16 changes: 9 additions & 7 deletions R/demography_ctfs.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,37 +74,39 @@
#' * `date2`, mean date in census 2.
#'
#' @examples
#' assert_is_installed("fgeo.x")
#'
#' census1 <- fgeo.x::tree5
#' census2 <- fgeo.x::tree6
#'
#'
#' as_tibble(
#' recruitment_ctfs(census1, census2)
#' )
#'
#'
#' # Use `interaction(...)` to aggregate by any number of grouping variables
#' sp_quadrat <- interaction(census1$sp, census1$quadrat)
#'
#'
#' recruitment <- recruitment_ctfs(
#' census1, census2,
#' split1 = sp_quadrat,
#' quiet = TRUE
#' )
#' as_tibble(recruitment)
#'
#'
#' mortality <- mortality_ctfs(
#' census1, census2,
#' split1 = sp_quadrat, quiet = TRUE
#' )
#' as_tibble(mortality)
#'
#'
#' growth <- growth_ctfs(census1, census2, split1 = sp_quadrat, quiet = TRUE)
#' as_tibble(growth)
#'
#'
#' # Easy way to separate grouping variables
#' tidyr_is_installed <- requireNamespace("tidyr", quietly = TRUE)
#' if (tidyr_is_installed) {
#' library(tidyr)
#'
#'
#' as_tibble(growth) %>%
#' separate(groups, into = c("sp", "quadrat"))
#' }
Expand Down
2 changes: 2 additions & 0 deletions R/fgeo_habitat.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#' as many distinct integer values as determined by the argument `n`.
#'
#' @examples
#' assert_is_installed("fgeo.x")
#'
#' # Input a ForestGEO-like elevation list or dataframe
#' elevation_ls <- fgeo.x::elevation
#' habitats <- fgeo_habitat(
Expand Down
4 changes: 4 additions & 0 deletions R/fgeo_topography.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#' Thanks to Jian Zhang for reporting a bug (issue 59).
#'
#' @examples
#' assert_is_installed("fgeo.x")
#'
#' elev_list <- fgeo.x::elevation
#' fgeo_topography(elev_list, gridsize = 20)
#'
Expand Down Expand Up @@ -102,6 +104,8 @@ abort_if_xdim_ydim_is_null <- function(xdim, ydim) {
#' @seealso [calcslope()], [quadslope()]
#'
#' @examples
#' assert_is_installed("fgeo.x")
#'
#' # The input to elev is very specific; you may need to tweak it.
#' elev <- fgeo.x::elevation
#' result <- allquadratslopes(
Expand Down
18 changes: 0 additions & 18 deletions R/has_table_names.R

This file was deleted.

5 changes: 5 additions & 0 deletions R/imports.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
#' @importFrom tibble tibble as.tibble as_tibble
NULL

#' @importFrom fgeo.tool assert_is_installed
#' @export
#' @keywords internal
fgeo.tool::assert_is_installed

#' Pipe operator
#'
#' See \code{magrittr::\link[magrittr]{\%>\%}} for details.
Expand Down
2 changes: 2 additions & 0 deletions R/summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#' @seealso [tt_test()], [base::summary()].
#'
#' @examples
#' assert_is_installed("fgeo.x")
#'
#' tt_result <- tt_test(fgeo.x::tree6_3species, fgeo.x::habitat)
#'
#' summary(tt_result)
Expand Down
9 changes: 8 additions & 1 deletion R/tt_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
#'
#' @examples
#' library(fgeo.tool)
#' assert_is_installed("fgeo.x")
#'
#' # Example data
#' tree <- fgeo.x::tree6_3species
Expand Down Expand Up @@ -406,7 +407,13 @@ rename_to_xy <- function(x) {
}

check_tt_test <- function(census, habitat, sp, plotdim, gridsize) {
has_stem_names <- !has_table_names(fgeo.x::tree6)(census)
tree_names <- c(
"treeID", "stemID", "tag", "StemTag", "sp", "quadrat", "gx", "gy",
"MeasureID", "CensusID", "dbh", "pom", "hom", "ExactDate", "DFstatus",
"codes", "nostems", "status", "date"
)
has_stem_names <- !all(names(census) %in% tree_names)

msg <- "Is `census` a tree table (not a stem table)? See `?tt_test()`."
if (has_stem_names) warn(msg)

Expand Down
25 changes: 21 additions & 4 deletions docs/news/index.html

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

1 change: 1 addition & 0 deletions man/abundance.Rd

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

2 changes: 2 additions & 0 deletions man/fgeo_habitat.Rd

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

2 changes: 2 additions & 0 deletions man/fgeo_topography.Rd

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

2 changes: 2 additions & 0 deletions man/recruitment_ctfs.Rd

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

5 changes: 4 additions & 1 deletion man/reexports.Rd

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

2 changes: 2 additions & 0 deletions man/summary.tt_df.Rd

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

1 change: 1 addition & 0 deletions man/tt_test.Rd

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

18 changes: 0 additions & 18 deletions tests/testthat/test-has_table_names.R

This file was deleted.

0 comments on commit 5163b32

Please sign in to comment.