# versione di seq.int.w che permette di avere # sequenze DI STRINGHE di lunghezza fissa con zeri a sinistra # GdA ottore 2009 #----------------------------------------------------------- seq.int.w <- function(from, to=NULL, by=1, length.out = NULL, along.with = NULL, ...){ library(Hmisc) # se c'e' un solo argomento viene interpretato come # finale, partendo da 1 if (is.null(to)) { to <- from from <- 1 } s <- seq.int(from, to, by, length.out) s.max <- s[length(s)] st <- sprintf("%s", s.max) s.len <- string.bounding.box(st)$columns sfmt <- sprintf("%%%di",s.len) s.str <- sprintf(sfmt, s) return( sedit(s.str, ' ', '0') ) }