Translated basic Matlab function blanks()
This commit is contained in:
parent
5fdff9fee2
commit
32e5020d62
4 changed files with 46 additions and 0 deletions
14
R/blanks.R
Normal file
14
R/blanks.R
Normal 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="")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue