Skip to content

Commit 0fd10ce

Browse files
committed
tabble
1 parent 0ef6d8c commit 0fd10ce

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export(source_R)
3030
export(split_rast)
3131
export(standardise_rast)
3232
export(std_rast)
33+
export(tabble)
3334
export(temptif)
3435
export(writereadrast)
3536
importFrom(magrittr,"%>%")

R/tabble.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#' Make a single-variable table and display it nicely in console
2+
#'
3+
#' @param x
4+
#' @param usena per `?table`
5+
#' @param n print how many rows eh?
6+
#'
7+
#' @returns
8+
#' @export
9+
#'
10+
#' @examples
11+
tabble <- function(
12+
x,
13+
usena = c("always", "no", "ifany"),
14+
n = 50
15+
){
16+
17+
usena <- match.arg(usena)
18+
19+
table(x, useNA = usena) |>
20+
as.data.frame() |>
21+
as_tibble() |>
22+
print(n = n)
23+
24+
}

man/tabble.Rd

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)