Skip to content

Commit

Permalink
removed strrep for now
Browse files Browse the repository at this point in the history
  • Loading branch information
trinker committed Mar 9, 2017
1 parent aa3afb3 commit e8385c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/f_pad_zero.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ f_pad_zero <- function(x, width = NULL, pad.char = '0', ...){
stopifnot(width >= maxd)
zeros <- width - lens

x[!is_na] <- paste0(strrep(pad.char, zeros[!is.na(zeros)]), x[!is_na])
## x[!is_na] <- paste0(strrep(pad.char, zeros[!is.na(zeros)]), x[!is_na]) #replace w/ this eventually
x[!is_na] <- paste0(unlist(lapply(zeros[!is.na(zeros)], function(x) paste(rep(pad.char, x), collapse = ""))), x[!is_na])
x
}

Expand Down

0 comments on commit e8385c0

Please sign in to comment.