Skip to content

Commit

Permalink
Renamed gridded() to quadrats(); fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
joeroe committed Sep 21, 2018
1 parent 0f99b00 commit b10ce59
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export(detect_normal)
export(detect_perfect)
export(detect_random)
export(detect_simple)
export(gridded)
export(interp_quadratcount)
export(mosaic)
export(quadrats)
export(rpolygon)
export(sample_random)
export(sample_systematic)
Expand Down
4 changes: 2 additions & 2 deletions R/sampling.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' library(ggplot2)
#'
#' rpolygon() %>%
#' gridded(n = c(10, 10)) %>%
#' quadrats(n = c(10, 10)) %>%
#' sample_random(n = 50) %>%
#' ggplot(aes(fill = sample)) + geom_sf()
sample_random <- function(units, n = NULL, fraction = NULL, column = "sample") {
Expand Down Expand Up @@ -64,7 +64,7 @@ sample_random <- function(units, n = NULL, fraction = NULL, column = "sample") {
#' library(ggplot2)
#'
#' rpolygon() %>%
#' gridded(n = c(10, 10)) %>%
#' quadrats(n = c(10, 10)) %>%
#' sample_systematic(n = 10) %>%
#' ggplot(aes(fill = sample)) + geom_sf()
sample_systematic <- function(units, n, start = 1, column = "sample") {
Expand Down
12 changes: 6 additions & 6 deletions R/units.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ rpolygon <- function(crs = 3395, origin = c(0,0), area = 100000,

#' Gridded survey units
#'
#' `gridded()` generates a regular, rectangular grid of survey units over a
#' `quadrats()` generates a regular, rectangular grid of survey units over a
#' frame.
#' `transects()` is a convenience function for when only a single row of units
#' is desired.
Expand All @@ -93,15 +93,15 @@ rpolygon <- function(crs = 3395, origin = c(0,0), area = 100000,
#' frame <- rpolygon()
#'
#' # North–south grid
#' grid <- gridded(frame, n = c(10, 10))
#' grid <- quadrats(frame, n = c(10, 10))
#' plot(grid)
#'
#' # NE–SW grid
#' grid <- gridded(frame, n = c(10, 10), orientation = 45)
#' grid <- quadrats(frame, n = c(10, 10), orientation = 45)
#' plot(grid)
#'
#' # Fixed size grid
#' grid <- gridded(frame, size = 100)
#' grid <- quadrats(frame, size = 100)
#' plot(grid)
#'
#' # Transects
Expand All @@ -117,7 +117,7 @@ rpolygon <- function(crs = 3395, origin = c(0,0), area = 100000,
#' plot(trans)
#'
#' @importFrom magrittr %>%
gridded <- function(frame, n = NULL, size = NULL, orientation = 0) {
quadrats <- function(frame, n = NULL, size = NULL, orientation = 0) {
checkmate::assert(checkmate::checkNumber(n),
checkmate::checkNumeric(n),
checkmate::checkNull(n))
Expand Down Expand Up @@ -163,7 +163,7 @@ gridded <- function(frame, n = NULL, size = NULL, orientation = 0) {
return()
}

#' @rdname gridded
#' @rdname quadrats
#' @export
transects <- function(frame, n = NULL, size = NULL, orientation = 0) {
checkmate::assert(checkmate::checkNumber(n), checkmate::checkNull(n))
Expand Down
14 changes: 7 additions & 7 deletions man/gridded.Rd → man/quadrats.Rd

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

2 changes: 1 addition & 1 deletion man/sample_random.Rd

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

2 changes: 1 addition & 1 deletion man/sample_systematic.Rd

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

0 comments on commit b10ce59

Please sign in to comment.