r - Put '00's in front of integers based on how large the number is? -


i have vector of calendar days such vec_day

vec_day<- c(8,14,365,9) vec_day [1]   8  14 365   9 

i transform vec_day2

vec_day2      [1] "008" "014" "365" "009"      

it can either string or vector

vec_day2 <- sprintf("%03d", vec_day) [1] "008" "014" "365" "009" 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -