diff options
-rw-r--r-- | DESCRIPTION | 2 | ||||
-rw-r--r-- | NAMESPACE | 1 | ||||
-rw-r--r-- | R/idframe.R | 16 | ||||
-rw-r--r-- | man/plot.idframe.Rd | 14 |
4 files changed, 14 insertions, 19 deletions
diff --git a/DESCRIPTION b/DESCRIPTION index 7a1d3a6..97bfd31 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,5 +11,5 @@ Description: The sysid package provides functions for constructing mathematical paramteric model estimation, and model predictions and validation. License: GPL-3 Imports: - signal,tframe,tfplot,zoo, ggplot2, reshape2, polynom + signal,tframe,zoo, ggplot2, reshape2, polynom RoxygenNote: 5.0.1 @@ -63,6 +63,5 @@ export(step) import(ggplot2) import(polynom) import(reshape2) -import(tfplot) import(tframe) importFrom(zoo,na.approx) diff --git a/R/idframe.R b/R/idframe.R index 65ffacc..3a33151 100644 --- a/R/idframe.R +++ b/R/idframe.R @@ -44,22 +44,19 @@ idframe <- function(output=NULL,input=NULL,Ts = 1,start=0,end=NULL, #' #' Plotting method for objects inherting from class \code{idframe} #' -#' @param x an object of class \code{idframe} +#' @param x an \code{idframe} object #' @param par a list of arguments passed to par() before plotting. #' @param col line color, to be passed to plot.(Default=\code{"steelblue"}) -#' @param ... additional arguments to be passed to the \code{tfplot} function +#' @param lwd line width, in millimeters(Default=\code{1}) #' -#' @seealso \code{\link[tfplot]{tfplot}} #' @examples #' data(cstr) #' plot(cstr,col="blue") #' -#' @import tfplot +#' @import ggplot2 reshape2 #' #' @export -plot.idframe <- function(x,par=list(mar=c(3,4,2,2)), - col="steelblue",...){ - require(tfplot) +plot.idframe <- function(x,col="steelblue",lwd=1){ if(nInputSeries(x)==0){ data <- outputData(x) } else if(nOutputSeries(x)==0){ @@ -68,7 +65,10 @@ plot.idframe <- function(x,par=list(mar=c(3,4,2,2)), data <- cbind(outputData(x),inputData(x)) colnames(data) <- c(outputNames(x),inputNames(x)) } - tfplot(data,Xaxis=NULL,par=par,col=col,...) + ggplot(melt(data.frame(time=as.numeric(time(data)), data), id.vars="time"), + aes(time, value)) + geom_line(size=lwd,color=col) + + facet_grid(variable ~ .,scale="free") + theme_bw(16,"sans") + ylab("") + + theme(axis.title.x=element_text(size=11)) } #' @export diff --git a/man/plot.idframe.Rd b/man/plot.idframe.Rd index 3c90cf9..cd92f37 100644 --- a/man/plot.idframe.Rd +++ b/man/plot.idframe.Rd @@ -4,17 +4,16 @@ \alias{plot.idframe} \title{Plotting idframe objects} \usage{ -\method{plot}{idframe}(x, par = list(mar = c(3, 4, 2, 2)), - col = "steelblue", ...) +\method{plot}{idframe}(x, col = "steelblue", lwd = 0.5) } \arguments{ -\item{x}{an object of class \code{idframe}} - -\item{par}{a list of arguments passed to par() before plotting.} +\item{x}{an \code{idframe} object} \item{col}{line color, to be passed to plot.(Default=\code{"steelblue"})} -\item{...}{additional arguments to be passed to the \code{tfplot} function} +\item{lwd}{line width, in millimeters(Default=\code{0.5})} + +\item{par}{a list of arguments passed to par() before plotting.} } \description{ Plotting method for objects inherting from class \code{idframe} @@ -24,7 +23,4 @@ data(cstr) plot(cstr,col="blue") } -\seealso{ -\code{\link[tfplot]{tfplot}} -} |