Skip to content

Commit

Permalink
Move ggplot2 to Suggests.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrice-rossi committed Mar 30, 2024
1 parent 6171146 commit 90d5dce
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Imports:
assertthat,
butcher,
cli,
ggplot2,
methods,
nnet,
pROC,
Expand All @@ -50,6 +49,7 @@ Suggests:
data.table,
foreach,
geodist,
ggplot2,
knitr,
rmarkdown,
testthat (>= 3.0.0),
Expand Down
5 changes: 2 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ S3method(as_covlmc,tune_covlmc)
S3method(as_vlmc,ctx_tree)
S3method(as_vlmc,ctx_tree_cpp)
S3method(as_vlmc,tune_vlmc)
S3method(autoplot,tune_covlmc)
S3method(autoplot,tune_vlmc)
S3method(children,ctx_node)
S3method(children,ctx_node_cpp)
S3method(coef,constant_model)
Expand Down Expand Up @@ -36,6 +34,8 @@ S3method(draw,vlmc_cpp)
S3method(find_sequence,covlmc)
S3method(find_sequence,ctx_tree)
S3method(find_sequence,ctx_tree_cpp)
S3method(ggplot2::autoplot,tune_covlmc)
S3method(ggplot2::autoplot,tune_vlmc)
S3method(glm_coef,constant_model)
S3method(glm_coef,default)
S3method(glm_coef,glm)
Expand Down Expand Up @@ -191,7 +191,6 @@ export(tune_vlmc)
export(vlmc)
import(Rcpp)
importFrom(Rcpp,evalCpp)
importFrom(ggplot2,autoplot)
importFrom(rlang,.data)
importFrom(stats,predict)
importFrom(stats,simulate)
Expand Down
4 changes: 2 additions & 2 deletions R/autoplot_tune.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' print(vlmc_plot)
#' ## simple post customisation
#' print(vlmc_plot + ggplot2::geom_point())
#' @export
#' @exportS3Method ggplot2::autoplot
autoplot.tune_vlmc <- function(object, cutoff = c("quantile", "native"), ...) {
cutoff <- match.arg(cutoff)
if (cutoff == "quantile") {
Expand Down Expand Up @@ -75,7 +75,7 @@ autoplot.tune_vlmc <- function(object, cutoff = c("quantile", "native"), ...) {
#' @param object a `tune_covlmc` object
#' @param ... additional parameters (not used currently)
#' @returns a ggplot object
#' @export
#' @exportS3Method ggplot2::autoplot
#' @examples
#' pc <- powerconsumption[powerconsumption$week %in% 10:12, ]
#' rdts <- cut(pc$active_power, breaks = c(0, quantile(pc$active_power, probs = c(0.5, 1))))
Expand Down
1 change: 0 additions & 1 deletion R/mixvlmc-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#' @importFrom Rcpp evalCpp
#' @importFrom stats simulate
#' @importFrom stats predict
#' @importFrom ggplot2 autoplot
#' @importFrom rlang .data
#' @useDynLib mixvlmc
## usethis namespace: end
Expand Down
2 changes: 2 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Rcpp::loadModule("suffixtree", TRUE)
.onLoad <- function(libname, pkgname) {
s3_register("ggplot2::autoplot", "tune_vlmc")
s3_register("ggplot2::autoplot", "tune_covlmc")
current_op <- options()
## default options
mixvlmc_options <- list(
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The package is loaded in a standard way.

```{r}
library(mixvlmc)
library(ggplot2)
library(ggplot2) ## we load ggplot2 for the autoplot examples
```

The main function of VLMC is `vlmc()` which can be called on a time series represented by a numerical vector or a factor, for instance.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The package is loaded in a standard way.

``` r
library(mixvlmc)
library(ggplot2)
library(ggplot2) ## we load ggplot2 for the autoplot examples
```

The main function of VLMC is `vlmc()` which can be called on a time
Expand Down

0 comments on commit 90d5dce

Please sign in to comment.