summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--R/preprocess.R15
-rw-r--r--man/misdata.Rd18
2 files changed, 32 insertions, 1 deletions
diff --git a/R/preprocess.R b/R/preprocess.R
index d47bb54..2d6767a 100644
--- a/R/preprocess.R
+++ b/R/preprocess.R
@@ -108,6 +108,21 @@ detrend.predict <- function(object,data){
#' Replace Missing Data by Interpolation
#'
+#' Function for replacing missing values with interpolated ones. This is an
+#' extension of the \code{na.approx} function from the \code{zoo} package.
+#' The missing data is indicated using the value \emph{NA}.
+#'
+#' @param data an object of class \code{idframe}
+#' @return
+#' data (an idframe object) with missing data replaced.
+#'
+#' @seealso \code{\link[zoo]{na.approx}}
+#'
+#' @examples
+#' data(cstr_mis)
+#' summary(cstr_mis) # finding out the number of NAs
+#' cstr <- misdata(cstr_mis)
+#'
#' @export
misdata <- function(data){
require(zoo)
diff --git a/man/misdata.Rd b/man/misdata.Rd
index 7ffd2e9..45ec512 100644
--- a/man/misdata.Rd
+++ b/man/misdata.Rd
@@ -6,7 +6,23 @@
\usage{
misdata(data)
}
+\arguments{
+\item{data}{an object of class \code{idframe}}
+}
+\value{
+data (an idframe object) with missing data replaced.
+}
\description{
-Replace Missing Data by Interpolation
+Function for replacing missing values with interpolated ones. This is an
+extension of the \code{na.approx} function from the \code{zoo} package.
+The missing data is indicated using the value \emph{NA}.
+}
+\examples{
+data(cstr_mis)
+summary(cstr_mis) # finding out the number of NAs
+cstr <- misdata(cstr_mis)
+}
+\seealso{
+\code{\link[zoo]{na.approx}}
}