From 0b25aed6c241ec05c0501165c9a4fc53772e4012 Mon Sep 17 00:00:00 2001 From: Suraj Yerramilli Date: Sat, 21 May 2016 19:03:55 +0530 Subject: loading ggplot2 namespace --- R/estpoly.R | 2 +- R/idframe.R | 2 ++ R/nonparam.R | 1 + R/predict.R | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) (limited to 'R') diff --git a/R/estpoly.R b/R/estpoly.R index 46b2ff7..f18646f 100644 --- a/R/estpoly.R +++ b/R/estpoly.R @@ -95,7 +95,7 @@ print.summary.estpoly <- function(x,digits=4){ #' @export plot.estpoly <- function(model,newdata=NULL){ - require(ggplot2) + loadNamespace("ggplot2") if(is.null(newdata)){ ypred <- ts(fitted(model),names="Predicted") diff --git a/R/idframe.R b/R/idframe.R index f38b94e..c0fc2bf 100644 --- a/R/idframe.R +++ b/R/idframe.R @@ -66,6 +66,7 @@ idframe <- function(output,input=NULL,Ts = 1,start=0,end=NULL, #' #' @export plot.idframe <- function(x,col="steelblue",lwd=1,main=NULL,size=12){ + loadNamespace("ggplot2") if(nInputSeries(x)==0){ data <- outputData(x) } else{ @@ -191,6 +192,7 @@ idfrd <- function(respData,freq,Ts,spec=NULL,covData=NULL, #' #' @export plot.idfrd <- function(x,col="steelblue",lwd=1){ + loadNamespace("ggplot2") nfreq <- dim(x$freq)[1] mag <- 20*log10(Mod(x$resp)) nout <- dim(mag)[1]; nin <- dim(mag)[2] diff --git a/R/nonparam.R b/R/nonparam.R index 9897a04..db5b004 100644 --- a/R/nonparam.R +++ b/R/nonparam.R @@ -91,6 +91,7 @@ impulsechannel <- function(y,u,N,M,K=0,regul=F,lambda=1){ #' #' @export plot.impulseest <- function(model,sd=2){ + loadNamespace("ggplot2") plotseq <- seq(model$noutputs*model$ninputs) g <- vector("list",model$nin*model$nout) diff --git a/R/predict.R b/R/predict.R index 67ed8d0..01a5fc9 100644 --- a/R/predict.R +++ b/R/predict.R @@ -98,6 +98,7 @@ predict.estpoly <- function(x,newdata=NULL,nahead=1){ #' @import ggplot2 reshape2 #' @export compare <- function(data,nahead=1,...){ + loadNamespace("ggplot2") # Input Validation input_list <- as.list(substitute(list(...)))[-1] dots <- list(...) -- cgit