Translated basic Matlab function blanks()

This commit is contained in:
Waldir Leoncio 2020-07-13 13:59:35 +02:00
parent 5fdff9fee2
commit 32e5020d62
4 changed files with 46 additions and 0 deletions

14
R/blanks.R Normal file
View file

@ -0,0 +1,14 @@
#' @title Blanks
#' @description Create character vector of blanks
#' @details This function emulates the behavior of a homonimous function from Matlab
#' @param n length of vector
#' @return Vector of n blanks
#' @author Waldir Leoncio
#' @export
blanks <- function(n) {
if (n < 0) {
warning("Negative n passed. Treating as n = 0")
n <- 0
}
paste(rep(" ", n), collapse="")
}