From da81ca14780865fd47383e5f4f41506afe25005c Mon Sep 17 00:00:00 2001 From: Chirag Anand Date: Wed, 28 Jun 2017 16:10:06 +0530 Subject: [PATCH] Fixed package dependencies and import issues. xts and zoo are still in Depends because xts 0.9-7 doesn't import zoo functions. --- DESCRIPTION | 5 +++-- NAMESPACE | 8 +++++++- R/eesInference.R | 4 ++-- inst/CITATION | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b7d4407..974f575 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: eventstudies Version: 1.2 -Date: 2015-04-09 +Date: 2017-06-28 Type: Package Title: Event Study Analysis Authors@R: c( @@ -18,11 +18,12 @@ Authors@R: c( email = "ajayshah@mayin.org") ) Maintainer: Chirag Anand -Depends: R (>= 3.0), zoo, xts, boot, testthat, sandwich +Depends: R (>= 3.4), zoo, xts Description: An R package for conducting event studies and a platform for methodological research on event studies. VignetteBuilder: knitr Suggests: knitr +Imports: boot, graphics, methods, testthat, sandwich, stats, utils License: GPL-2 URL: https://github.com/nipfpmf/eventstudies BugReports: https://github.com/nipfpmf/eventstudies/issues/new diff --git a/NAMESPACE b/NAMESPACE index 837a4fc..717cf27 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,4 +17,10 @@ S3method(plot, amm) S3method(plot, es) S3method(plot, ees) -import(boot, sandwich, testthat, xts, zoo) +importFrom("graphics", "abline", "legend", "lines", "par", "plot", + "plot.default", "points") +importFrom("methods", "formalArgs") +importFrom("utils", "capture.output", "head", "tail") +importFrom("boot", "boot", "boot.ci") + +import(sandwich, stats, testthat, xts, zoo) diff --git a/R/eesInference.R b/R/eesInference.R index 1b2a299..9162fc4 100644 --- a/R/eesInference.R +++ b/R/eesInference.R @@ -460,11 +460,11 @@ yearly.exevent.summary <- function(tmp){ # Bad days tmp.bad.y <- apply.yearly(xts(tmp.bad),function(x)nrow(x)) tmp.bad.y <- merge(tmp.bad.y,apply.yearly(xts(tmp.bad[,1]),function(x)median(x,na.rm=T))) - index(tmp.bad.y) <- as.yearmon(as.Date(substr(index(tmp.bad.y),1,4),"%Y")) + index(tmp.bad.y) <- zoo::as.yearmon(as.Date(substr(index(tmp.bad.y),1,4),"%Y")) # Good days tmp.good.y <- apply.yearly(xts(tmp.good),function(x)nrow(x)) tmp.good.y <- merge(tmp.good.y,apply.yearly(xts(tmp.good[,1]),function(x)median(x,na.rm=T))) - index(tmp.good.y) <- as.yearmon(as.Date(substr(index(tmp.good.y),1,4),"%Y")) + index(tmp.good.y) <- zoo::as.yearmon(as.Date(substr(index(tmp.good.y),1,4),"%Y")) tmp.res <- merge(tmp.bad.y,tmp.good.y) colnames(tmp.res) <- c("total.events.l","median.value.l", "total.events.u","median.value.u") diff --git a/inst/CITATION b/inst/CITATION index 47e1fcc..f823dfd 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -6,4 +6,4 @@ bibentry(bibtype = "Manual", person("Ajay", "Shah")), organisation = "NIPFP, Macro/Finance group", year = 2014, - url = "http://CRAN.R-project.org/package=eventstudies") + url = "https://CRAN.R-project.org/package=eventstudies")