diff options
author | Suraj Yerramilli | 2015-06-05 15:29:39 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-06-05 15:29:39 +0530 |
commit | 061d59641948d9e64c1f2dd79de85a98fe18bbed (patch) | |
tree | 12fcc02dde4023e2425b4a7bcfbdffdd4fb98e78 /R | |
parent | ea1fd0790dd2899b2f04328e2048e7bbeb4f7d64 (diff) | |
download | SysID-R-code-061d59641948d9e64c1f2dd79de85a98fe18bbed.tar.gz SysID-R-code-061d59641948d9e64c1f2dd79de85a98fe18bbed.tar.bz2 SysID-R-code-061d59641948d9e64c1f2dd79de85a98fe18bbed.zip |
Minor Changes in the idframe constructor
Diffstat (limited to 'R')
-rw-r--r-- | R/idframe.R | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/R/idframe.R b/R/idframe.R index be4f0f2..da20fa2 100644 --- a/R/idframe.R +++ b/R/idframe.R @@ -23,19 +23,19 @@ #' data <- idframe(output=dataMatrix[,3:5],input=dataMatrix[,1:2],Ts=1) #' #' @export -idframe <- function(output=numeric(0),input=numeric(0), +idframe <- function(output=NULL,input=NULL, type=c("time","freq")[1],Ts = 1, - t.start=0,t.end=NA, tUnit = "seconds", - frequencies = NA, fUnit= "Hz"){ + t.start=0,t.end=NULL, tUnit = "seconds", + frequencies = NULL, fUnit= "Hz"){ ## Input Validation if(!(type %in% c("time","freq"))) # type validation stop("Unknown domain type") - if(length(output)!=0 && length(input)!=0){ - if(dim(output)[1]!=dim(input)[1]) # observation validation - stop("Dimensions don't match") - } + #if(length(output)!=0 && length(input)!=0){ + # if(dim(output)[1]!=dim(input)[1]) # observation validation + # stop("Dimensions don't match") + #} # Object Constructor dat <- list(output=data.frame(output),input=data.frame(input),type=type,Ts=Ts) @@ -44,7 +44,7 @@ idframe <- function(output=numeric(0),input=numeric(0), if(type=="freq"){ - if(is.na(frequencies)){ + if(is.null(frequencies)){ frequncies <- seq(0,2*pi,length=n) } @@ -53,7 +53,7 @@ idframe <- function(output=numeric(0),input=numeric(0), } else { - if(is.na(t.end)) { + if(is.null(t.end)) { t.end <- t.start + Ts*(n-1) } else { dat$Ts <- (t.end-t.start)/(n-1) |