diff options
author | Suraj Yerramilli | 2015-01-18 10:45:19 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-01-18 10:45:19 +0530 |
commit | af1fcee01da6994b2d49b44142bc4829c8012e2c (patch) | |
tree | 48d2ab30913eed3fbee37360ce60031520371145 /R/idframe.R | |
parent | 41d42b00f7e86581ba23347cf38337d81e4d0101 (diff) | |
download | SysID-R-code-af1fcee01da6994b2d49b44142bc4829c8012e2c.tar.gz SysID-R-code-af1fcee01da6994b2d49b44142bc4829c8012e2c.tar.bz2 SysID-R-code-af1fcee01da6994b2d49b44142bc4829c8012e2c.zip |
added input validation
Diffstat (limited to 'R/idframe.R')
-rw-r--r-- | R/idframe.R | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/R/idframe.R b/R/idframe.R index 0040629..8be4d67 100644 --- a/R/idframe.R +++ b/R/idframe.R @@ -5,6 +5,14 @@ idframe <- function(output=data.frame(numeric(0)),input=data.frame(numeric(0)), t.start=0,t.end=NA, timeUnit = "seconds", frequencies = NA, freqUnit= "Hz"){ + ## Input Validation + if(!(type %in% c("time","freq"))) # type validation + stop("Unknown domain type") + + if(dim(output)[1]!=dim(input)[1]) # observation validation + stop("Dimensions don't matach") + + # Object Constructor dat <- list(output=data.frame(output),input=data.frame(input),type=type,Ts=Ts) n <- dim(output)[1] p <- dim(output)[2];m <- dim(input)[2] @@ -56,5 +64,4 @@ plot.idframe <- function(object,...){ # summary method for idframe object summary.idframe <- function(object,...){ -} - +}
\ No newline at end of file |