addLeadingZerosToCharInt | R Documentation |
Adds leading zeros to all columns that can be identified as integers in a data.frame that consists of character columns only.
addLeadingZerosToCharInt(dat)
dat |
a data.frame consisting of character columns only |
a data.frame of only character columns and the same dimensions as the input data.frame where all columns with integers are all of the same arity now due to added leading zeros.
Karoline Sachse
dat <- data.frame(v1 = c("0","300","e",NA),
v2=c("0","90","10000",NA),
v3=c("k","kk","kkk",NA),
v4=NA,
v5=c("0","90","100","1"))
dat <- set.col.type(dat)
addLeadingZerosToCharInt(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.