% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/zeroPad.R
\name{zeroPad}
\alias{zeroPad}
\title{Pad string with leading zeros}
\usage{
zeroPad(x, padTo)
}
\arguments{
\item{x}{character}

\item{padTo}{number Final desired length of the character}
}
\value{
x character 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 <- zeroPad(pCode, 5)
pCodes <- c("100", "1000", "0", "12345", "1565465465465465")
correctPCodes <- zeroPad(pCodes, 5)
pCodeNA <- c(1, 2, NA)
padPCodeNA <- zeroPad(pCodeNA, 4)
}
\keyword{USGS}
\keyword{data}
\keyword{import}
\keyword{service}
\keyword{web}
