1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 23:21:56 +02:00

try to support older R versions

This commit is contained in:
2018-04-18 14:50:16 +02:00
parent 2509e2413d
commit a814d82b4b
7 changed files with 15 additions and 3 deletions

View File

@ -337,7 +337,7 @@ freq <- function(x,
'; ',
(Count.rest / length(x)) %>% percent(force_zero = TRUE),
')'),
'. Use `nmax` to show more rows.\n\n', sep = '')
'. Use `nmax` to show more rows.\n', sep = '')
} else {
print(

View File

@ -111,3 +111,12 @@ size_humanreadable <- function(bytes, decimals = 1) {
out <- paste(sprintf(paste0("%.", decimals, "f"), bytes / (1024 ^ factor)), size[factor + 1])
out
}
# strrep is only available in R 3.3 and later
# and we want to support R 3.2 too, so:
strrep <- function(x, times) {
for (i in 1:length(x)) {
x[i] <- paste(rep(x[i], times[i]), collapse = "")
}
x
}

View File

@ -28,6 +28,7 @@
#' @rdname print
#' @name print
#' @importFrom dplyr %>% n_groups group_vars group_size filter pull select
#' @importFrom data.table data.table
#' @exportMethod print.tbl_df
#' @export
#' @examples