Skip to content
Snippets Groups Projects
padVariable.Rd 507 B
Newer Older
  • Learn to ignore specific revisions
  • Laura A DeCicco's avatar
    Laura A DeCicco committed
    \name{padVariable}
    \alias{padVariable}
    \title{Pad string with leading zeros}
    \usage{
      padVariable(x, padTo)
    }
    \arguments{
      \item{x}{string}
    
      \item{padTo}{number Final desired length of the string}
    }
    \value{
      x string returned with leading zeros
    }
    \description{
      Function to pad a string with leading zeros. Useful for
      parameter codes and USGS site IDs.
    }
    \examples{
    pCode <- '10'
    correctPCode <- padVariable(pCode,5)
    }
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    \keyword{USGS}
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    \keyword{data}
    \keyword{import}
    \keyword{service}
    \keyword{web}