diff options
author | Suraj Yerramilli | 2015-02-07 00:59:33 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-02-07 00:59:33 +0530 |
commit | f9b0b6607be23df7929acab838767a62b502bfbd (patch) | |
tree | 147220802e35fed926e21cc96ca12fd7f047a110 | |
parent | 36badfa251da470b534029eecf62dba8276ddba9 (diff) | |
download | SysID-R-code-f9b0b6607be23df7929acab838767a62b502bfbd.tar.gz SysID-R-code-f9b0b6607be23df7929acab838767a62b502bfbd.tar.bz2 SysID-R-code-f9b0b6607be23df7929acab838767a62b502bfbd.zip |
changed argument names
-rw-r--r-- | R/partition.R | 32 | ||||
-rw-r--r-- | man/dataPartition.Rd | 6 | ||||
-rw-r--r-- | man/dataSlice.Rd | 8 |
3 files changed, 23 insertions, 23 deletions
diff --git a/R/partition.R b/R/partition.R index e64e1fb..7c0af2b 100644 --- a/R/partition.R +++ b/R/partition.R @@ -1,19 +1,19 @@ -#' Subset an idframe object +#' Subset an idframe data #' -#' Subsetting method for objects of class \code{idframe} +#' Subsetting method for datas of class \code{idframe} #' -#' @param object an object of class \code{idframe} +#' @param data an object of class \code{idframe} #' @param indices the indices that need to be subsetted #' @export -dataSlice <- function(object,indices){ +dataSlice <- function(data,indices){ # check if the class is correct - if(class(object)!='idframe') - stop("Not an idframe object") + if(class(data)!='idframe') + stop("Not an idframe data") - if(!all(indices %in% seq(to=dim(object$output)[1],by=1))) + if(!all(indices %in% seq(to=dim(data$output)[1],by=1))) stop("Invalid indices") - trim <- object + trim <- data trim$output <- trim$output[indices,,drop=F] trim$input <- trim$input[indices,,drop=F] @@ -32,9 +32,9 @@ dataSlice <- function(object,indices){ #' The function splits the data into training and validation sets and returns them bundled #' as a list. The size of the sets are determined by the parameter \code{p}. #' -#' @param object an object of class \code{idframe} +#' @param data an object of class \code{idframe} #' @param p the percentage of the data that goes to training (Default : \code{0.6}) -#' @return list containing estimation and validation idframe objects +#' @return list containing estimation and validation idframe datas #' #' @examples #' data(cstr) @@ -43,18 +43,18 @@ dataSlice <- function(object,indices){ #' test <- splitList$validation # testing set #' #' @export -dataPartition <- function(object,p=0.6){ +dataPartition <- function(data,p=0.6){ # check if the class is correct - if(class(object)!='idframe') - stop("Not an idframe object") + if(class(data)!='idframe') + stop("Not an idframe data") - index <- seq_along(object$output[,1]) + index <- seq_along(data$output[,1]) trainIndex <- index[1:round(p*length(index))] testIndex <- index[!(index %in% trainIndex)] - train <- dataSlice(object,trainIndex) - test <- dataSlice(object,testIndex) + train <- dataSlice(data,trainIndex) + test <- dataSlice(data,testIndex) return(list(estimation=train,validation=test)) }
\ No newline at end of file diff --git a/man/dataPartition.Rd b/man/dataPartition.Rd index afcc473..2ac7ef5 100644 --- a/man/dataPartition.Rd +++ b/man/dataPartition.Rd @@ -4,15 +4,15 @@ \alias{dataPartition} \title{Split data into training and validation sets} \usage{ -dataPartition(object, p = 0.6) +dataPartition(data, p = 0.6) } \arguments{ -\item{object}{an object of class \code{idframe}} +\item{data}{an object of class \code{idframe}} \item{p}{the percentage of the data that goes to training (Default : \code{0.6})} } \value{ -list containing estimation and validation idframe objects +list containing estimation and validation idframe datas } \description{ The function splits the data into training and validation sets and returns them bundled diff --git a/man/dataSlice.Rd b/man/dataSlice.Rd index 2489cc3..52eb438 100644 --- a/man/dataSlice.Rd +++ b/man/dataSlice.Rd @@ -2,16 +2,16 @@ % Please edit documentation in R/partition.R \name{dataSlice} \alias{dataSlice} -\title{Subset an idframe object} +\title{Subset an idframe data} \usage{ -dataSlice(object, indices) +dataSlice(data, indices) } \arguments{ -\item{object}{an object of class \code{idframe}} +\item{data}{an object of class \code{idframe}} \item{indices}{the indices that need to be subsetted} } \description{ -Subsetting method for objects of class \code{idframe} +Subsetting method for datas of class \code{idframe} } |