% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllConstructor.R
\name{na_to_length}
\alias{na_to_length}
\title{NA to specific length}
\usage{
na_to_length(x, temp, value)
}
\arguments{
\item{x}{The vector to check.}

\item{temp}{A template vector to use to determine the length.}

\item{value}{The value to use to fill the vector.}
}
\value{
A vector with the same length as temp.
}
\description{
Check if all value in a vector is \code{NA} or \code{NULL}.
If so set all of them to a new value matching the length
of the template.
If not check that the size of the vector is equal to
the template.
}
\examples{
Pedixplorer:::na_to_length(NA, rep(0, 4), "NewValue")
Pedixplorer:::na_to_length(c(1, 2, 3, NA), rep(0, 4), "NewValue")
}
\keyword{internal}
