Displaying 1 result from an estimated 1 matches for "int2char".
Did you mean:
in_char
2005 Jan 05
5
Converting integers to chars i.e 1 to "01"
...2.png
...
figure_1.png
figure_20.png
...
So I would like to convert integers to something like 01 if upper limit for
this conert is 10 or 001 for 100. I wrote a simple function (see below),
but I do not know how this limit stuff can be imporved to work really well
with default. Any suggestions?
int2char <- function(x, limit = max(x)) {
# Description:
# Converts integer to character such that numbers bellow limit get 0 in
# front
# Gregor GORJANC, 2005-01-05
# Arguments:
# x: vector of numbers
# limit: limit up to which numbers should get 0 in front, default...