try to support older R versions

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2018-04-18 14:50:16 +02:00
1 parent 2509e2413d
commit a814d82b4b
7 files changed
+15 -3

No files matched your search

+1 -1
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(
+9
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
}
+1
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