summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-02-26 19:58:18 +0530
committerSuraj Yerramilli2016-02-26 19:58:18 +0530
commit0726b257528b292ce27b27453ea8990aa4b0645f (patch)
tree72625944e36f899253805d304e56a7a779af5880
parent23d4a99c600e6083ad8564a0044c6c81d2b711f7 (diff)
downloadSysID-R-code-0726b257528b292ce27b27453ea8990aa4b0645f.tar.gz
SysID-R-code-0726b257528b292ce27b27453ea8990aa4b0645f.tar.bz2
SysID-R-code-0726b257528b292ce27b27453ea8990aa4b0645f.zip
fixing an error with plot
-rw-r--r--R/idframe.R2
-rw-r--r--R/ioNamesData.R4
2 files changed, 3 insertions, 3 deletions
diff --git a/R/idframe.R b/R/idframe.R
index af813f5..2bb416b 100644
--- a/R/idframe.R
+++ b/R/idframe.R
@@ -68,8 +68,6 @@ idframe <- function(output,input=NULL,Ts = 1,start=0,end=NULL,
plot.idframe <- function(x,col="steelblue",lwd=1,main=NULL){
if(nInputSeries(x)==0){
data <- outputData(x)
- } else if(nOutputSeries(x)==0){
- data <- inputData(x)
} else{
data <- cbind(outputData(x),inputData(x))
colnames(data) <- c(outputNames(x),inputNames(x))
diff --git a/R/ioNamesData.R b/R/ioNamesData.R
index a17cca5..e951cc3 100644
--- a/R/ioNamesData.R
+++ b/R/ioNamesData.R
@@ -1,5 +1,7 @@
#' @export
-nInputSeries <- function(data) ncol(data$input)
+nInputSeries <- function(data) {
+ ifelse(is.null(data$input),0,ncol(data$input))
+}
#' @export
nOutputSeries <- function(data) ncol(data$output)