joshuaulrich / xts

Extensible time series class that provides uniform handling of many R time series classes by extending zoo.
http://joshuaulrich.github.io/xts/
GNU General Public License v2.0
219 stars 71 forks source link

Release 0.13.0 #386

Closed joshuaulrich closed 1 year ago

joshuaulrich commented 1 year ago

Milestone

Package Testing

Reverse Dependency Checks

CRAN

joshuaulrich commented 1 year ago

CRAN checks found the following changes to worse in reverse depends. Not sure why these didn't show up in my checks... need to investigate and replicate.

Package: ichimoku

Package: ichimoku
Check: examples
New result: ERROR
  Running examples in ‘ichimoku-Ex.R’ failed
  The error most likely occurred in:

  > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
  > ### Name: ichimoku
  > ### Title: ichimoku
  > ### Aliases: ichimoku ichimoku.ichimoku ichimoku.xts ichimoku.data.frame
  > ###   ichimoku.matrix ichimoku.default
  >
  > ### ** Examples
  >
  > TKR <- sample_ohlc_data
  >
  > cloud <- ichimoku(TKR)
  > cloud
   ichimoku   [ more() to display more rows | look() to inspect attributes ]
    object
  Error in index[(nr - max + 1):nr] :
    only 0's may be mixed with negative subscripts
  Calls: <Anonymous> -> print.ichimoku -> NextMethod -> print.xts
  Execution halted

Package: ichimoku
Check: re-building of vignette outputs
New result: ERROR
  Error(s) in re-building vignettes:
    ...
  --- re-building ‘reference.Rmd’ using rmarkdown
  Quitting from lines 131-134 (reference.Rmd)
  Error: processing vignette ‘reference.Rmd’ failed with diagnostics:
  only 0's may be mixed with negative subscripts
  --- failed re-building ‘reference.Rmd’

  --- re-building ‘strategies.Rmd’ using rmarkdown
  --- finished re-building ‘strategies.Rmd’

  --- re-building ‘utilities.Rmd’ using rmarkdown
  --- finished re-building ‘utilities.Rmd’

  --- re-building ‘xoanda.Rmd’ using rmarkdown
  --- finished re-building ‘xoanda.Rmd’

  SUMMARY: processing the following file failed:
    ‘reference.Rmd’

  Error: Vignette re-building failed.
  Execution halted

Package: ichimoku
Check: tests
New result: ERROR
    Running ‘testthat.R’ [4s/4s]
  Running the tests in ‘tests/testthat.R’ failed.
  Complete output:
    > library(testthat)
    > library(ichimoku)
    >
    > test_check("ichimoku")
    Data verified by SHA256: 240e376e1ff038f5f014e3b75a6ca5ecb50ba640d0585ab9dda084416a1158bb
    Data verified by SHA256: 240e376e1ff038f5f014e3b75a6ca5ecb50ba640d0585ab9dda084416a1158bb
    Archive read from '/home/hornik/tmp/scratch/RtmpUjZXZU/file335c373dd34fdf'
    Loading required package: shiny
    [ FAIL 1 | WARN 0 | SKIP 0 | PASS 203 ]

    ══ Failed tests ════════════════════════════════════════════════════════════════
    ── Error ('test-ichimoku.R:63'): print method ok ───────────────────────────────
    Error in `index[(nr - max + 1):nr]`: only 0's may be mixed with negative subscripts
    Backtrace:
         ▆
      1. ├─testthat::expect_output(expect_s3_class(print(cloud), "ichimoku")) at test-ichimoku.R:63:2
      2. │ └─testthat:::quasi_capture(...)
      3. │   ├─testthat (local) .capture(...)
      4. │   │ └─testthat::capture_output_lines(code, print, width = width)
      5. │   │   └─testthat:::eval_with_output(code, print = print, width = width)
      6. │   │     ├─withr::with_output_sink(path, withVisible(code))
      7. │   │     │ └─base::force(code)
      8. │   │     └─base::withVisible(code)
      9. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     10. ├─testthat::expect_s3_class(print(cloud), "ichimoku")
     11. │ └─testthat::quasi_label(enquo(object), arg = "object")
     12. │   └─rlang::eval_bare(expr, quo_get_env(quo))
     13. ├─base::print(cloud)
     14. ├─ichimoku:::print.ichimoku(cloud)
     15. ├─base::NextMethod(max = if (length(dim)) dim[2L] * rows, ...)
     16. └─xts:::print.xts(cloud, max = `<int>`)

    [ FAIL 1 | WARN 0 | SKIP 0 | PASS 203 ]
    Error: Test failures
    Execution halted

Package: PerformanceAnalytics

Package: PerformanceAnalytics
Check: tests
New result: ERROR
    Running ‘tinytest.R’ [1s/1s]
  Running the tests in ‘tests/tinytest.R’ failed.
  Complete output:
    > if ( requireNamespace("tinytest", quietly=TRUE) ){
    +   
    +   tinytest::test_package("PerformanceAnalytics")
    +
    +   }
    Loading required package: xts
    Loading required package: zoo

    Attaching package: 'zoo'

    The following objects are masked from 'package:base':

        as.Date, as.Date.numeric

    ################################### WARNING ###################################
    # We noticed you have dplyr installed. The dplyr lag() function breaks how    #
    # base R's lag() function is supposed to work, which breaks lag(my_xts).      #
    #                                                                             #
    # If you call library(dplyr) later in this session, then calls to lag(my_xts) #
    # that you enter or source() into this session won't work correctly.          #
    #                                                                             #
    # All package code is unaffected because it is protected by the R namespace   #
    # mechanism.                                                                  #
    #                                                                             #
    # Set `options(xts.warn_dplyr_breaks_lag = FALSE)` to suppress this warning.  #
    ################################### WARNING ###################################

    Attaching package: 'PerformanceAnalytics'

    The following object is masked from 'package:graphics':

        legend

    test_PerformanceAnalytics.R...    1 tests  [0;32mOK [0m  [0;36m70ms [0m

    test_Return.portfolio.geometric.R    0 tests   
    test_Return.portfolio.geometric.R    0 tests   
    test_Return.portfolio.geometric.R    0 tests   
    test_Return.portfolio.geometric.R    0 tests   
    test_Return.portfolio.geometric.R    0 tests   
    test_Return.portfolio.geometric.R    0 tests   
    test_Return.portfolio.geometric.R    0 tests   
    test_Return.portfolio.geometric.R    2 tests  [0;32mOK [0m
    test_Return.portfolio.geometric.R    2 tests  [0;32mOK [0m
    test_Return.portfolio.geometric.R    2 tests  [0;32mOK [0m
    test_Return.portfolio.geometric.R    4 tests  [0;32mOK [0m  [0;36m100ms [0m

    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    0 tests   
    test_to.period.contributions.R    1 tests  [0;32mOK [0m
    test_to.period.contributions.R    3 tests  [0;32mOK [0m
    test_to.period.contributions.R    5 tests  [0;32mOK [0m
    test_to.period.contributions.R    7 tests  [0;32mOK [0m
    test_to.period.contributions.R    8 tests  [0;32mOK [0m
    test_to.period.contributions.R    9 tests  [0;32mOK [0m
    test_to.period.contributions.R   10 tests  [0;32mOK [0m
    test_to.period.contributions.R   11 tests  [0;31m1 fails [0m
    test_to.period.contributions.R   12 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   13 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   14 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   15 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   16 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   17 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   17 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   17 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   18 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   18 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   19 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   19 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   20 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   20 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   20 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   20 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   20 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   20 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   21 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   22 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   23 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   23 tests  [0;31m2 fails [0m
    test_to.period.contributions.R   24 tests  [0;31m2 fails [0m  [0;34m0.2s [0m
    ----- FAILED[data]: test_to.period.contributions.R<91--93>
     call| expect_equivalent(periodicity(to.monthly.contributions(daily_contribution))$scale,
     call| -->    "monthly", info = "the main function and periodic versions do not throw an error")
     diff| Expected 'monthly', got 'weekly'
     info| the main function and periodic versions do not throw an error
    ----- FAILED[data]: test_to.period.contributions.R<94--96>
     call| expect_equivalent(periodicity(to.monthly.contributions(weekly_contribution))$scale,
     call| -->    "monthly", info = "the main function and periodic versions do not throw an error")
     diff| Expected 'monthly', got 'weekly'
     info| the main function and periodic versions do not throw an error
    Error: 2 out of 29 tests failed
    In addition: There were 45 warnings (use warnings() to see them)
    Execution halted

Package: PortfolioAnalytics

Package: PortfolioAnalytics
Check: re-building of vignette outputs
New result: ERROR
  Error(s) in re-building vignettes:
    ...
  --- re-building ‘ROI_vignette.Rnw’ using Sweave
  Warning: executing %dopar% sequentially: no parallel backend registered
  --- finished re-building ‘ROI_vignette.Rnw’

  --- re-building ‘custom_moments_objectives.Rnw’ using Sweave
  Loading required package: zoo

  Attaching package: ‘zoo’

  The following objects are masked from ‘package:base’:

      as.Date, as.Date.numeric

  Loading required package: xts
  Loading required package: foreach
  Loading required package: PerformanceAnalytics

  Attaching package: ‘PerformanceAnalytics’

  The following object is masked from ‘package:graphics’:

      legend

  Loading required package: parallel

  DEoptim package
  Differential Evolution algorithm in R
  Authors: D. Ardia, K. Mullen, B. Peterson and J. Ulrich

  Loading required package: MASS
  Leverage constraint min_sum and max_sum are restrictive,
                consider relaxing. e.g. 'full_investment' constraint should be min_sum=0.99 and max_sum=1.01
  --- finished re-building ‘custom_moments_objectives.Rnw’

  --- re-building ‘portfolio_vignette.Rnw’ using Sweave
  Loading required package: zoo

  Attaching package: ‘zoo’

  The following objects are masked from ‘package:base’:

      as.Date, as.Date.numeric

  Loading required package: xts
  Loading required package: foreach
  Loading required package: PerformanceAnalytics

  Attaching package: ‘PerformanceAnalytics’

  The following object is masked from ‘package:graphics’:

      legend

  Warning: executing %dopar% sequentially: no parallel backend registered
  Loading required package: parallel

  DEoptim package
  Differential Evolution algorithm in R
  Authors: D. Ardia, K. Mullen, B. Peterson and J. Ulrich

  ROI: R Optimization Infrastructure
  Registered solver plugins: nlminb, glpk.
  Default solver: auto.

  Attaching package: ‘ROI’

  The following objects are masked from ‘package:PortfolioAnalytics’:

      is.constraint, objective

  Loading required package: ROI.plugin.glpk
  Loading required package: ROI.plugin.quadprog
  --- finished re-building ‘portfolio_vignette.Rnw’

  --- re-building ‘risk_budget_optimization.Rnw’ using Sweave
  Loading required package: zoo

  Attaching package: ‘zoo’

  The following objects are masked from ‘package:base’:

      as.Date, as.Date.numeric

  Loading required package: xts
  Loading required package: foreach
  Loading required package: PerformanceAnalytics

  Attaching package: ‘PerformanceAnalytics’

  The following object is masked from ‘package:graphics’:

      legend

  Loading required package: parallel

  DEoptim package
  Differential Evolution algorithm in R
  Authors: D. Ardia, K. Mullen, B. Peterson and J. Ulrich

  Warning in tzone.xts(x) : index does not have a ‘tzone’ attribute
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in tzone.xts(x) : index does not have a ‘tzone’ attribute
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in index.xts(x) :
    index does not have a ‘tclass’ attribute
      returning c("POSIXct", "POSIXt")
  Warning in tzone.xts(x) : index does not have a ‘tzone’ attribute
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in tzone.xts(x) : index does not have a ‘tzone’ attribute
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in index.xts(x) :
    index does not have a ‘tclass’ attribute
      returning c("POSIXct", "POSIXt")
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in index.xts(x) :
    index does not have a ‘tclass’ attribute
      returning c("POSIXct", "POSIXt")
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in index.xts(x) :
    index does not have a ‘tclass’ attribute
      returning c("POSIXct", "POSIXt")
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in index.xts(x) :
    index does not have a ‘tclass’ attribute
      returning c("POSIXct", "POSIXt")
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in index.xts(x) :
    index does not have a ‘tclass’ attribute
      returning c("POSIXct", "POSIXt")
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in index.xts(x) :
    index does not have a ‘tclass’ attribute
      returning c("POSIXct", "POSIXt")
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in index.xts(x) :
    index does not have a ‘tclass’ attribute
      returning c("POSIXct", "POSIXt")
  Warning in tclass.xts(x) : index does not have a ‘tclass’ attribute
  Warning in tclass.xts(x) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in tclass.xts([match.to](http://match.to/)) :
    index does not have a ‘tclass’ attribute
  Warning in tclass.xts([match.to](http://match.to/)) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in tclass.xts([match.to](http://match.to/)) :
    index does not have a ‘tclass’ attribute
  Warning in tclass.xts([match.to](http://match.to/)) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""
  Warning in tzone.xts([match.to](http://match.to/)) :
    index does not have a ‘tzone’ attribute
  Warning in tzone.xts([match.to](http://match.to/)) :
    index does not have a ‘tzone’ attribute
  Warning in tclass.xts([match.to](http://match.to/)) :
    index does not have a ‘tclass’ attribute
  Warning in tclass.xts([match.to](http://match.to/)) :
    could not find a ‘tclass’ or ‘.indexCLASS’ attribute; setting tclass to ""

  Error: processing vignette ‘risk_budget_optimization.Rnw’ failed with diagnostics:
   chunk 8
  Error in `tclass<-.xts`(`*tmp*`, value = tclass([match.to](http://match.to/))) :
    unsupported ‘tclass’ indexing type:

  --- failed re-building ‘risk_budget_optimization.Rnw’

  SUMMARY: processing the following file failed:
    ‘risk_budget_optimization.Rnw’

  Error: Vignette re-building failed.
  Execution halted

Package: timetk

Package: timetk
Check: tests
New result: ERROR
    Running ‘testthat.R’ [15s/16s]
  Running the tests in ‘tests/testthat.R’ failed.
  Complete output:
    > library(testthat)
    > library(timetk)
    > library(tidyverse)
    ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
    ✔ ggplot2 3.4.0      ✔ purrr   1.0.1
    ✔ tibble  3.1.8      ✔ dplyr   1.0.10
    ✔ tidyr   1.2.1      ✔ stringr 1.5.0
    ✔ readr   2.1.3      ✔ forcats 0.5.2
    ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
    ✖ readr::edition_get()   masks testthat::edition_get()
    ✖ dplyr::filter()        masks stats::filter()
    ✖ purrr::is_null()       masks testthat::is_null()
    ✖ dplyr::lag()           masks stats::lag()
    ✖ readr::local_edition() masks testthat::local_edition()
    ✖ dplyr::matches()       masks tidyr::matches(), testthat::matches()
    > library(tidyquant)
    Loading required package: lubridate
    Loading required package: timechange

    Attaching package: 'lubridate'

    The following objects are masked from 'package:base':

        date, intersect, setdiff, union

    Loading required package: PerformanceAnalytics
    Loading required package: xts
    Loading required package: zoo

    Attaching package: 'zoo'

    The following objects are masked from 'package:base':

        as.Date, as.Date.numeric

    ################################### WARNING ###################################
    # We noticed you have dplyr installed. The dplyr lag() function breaks how    #
    # base R's lag() function is supposed to work, which breaks lag(my_xts).      #
    #                                                                             #
    # Calls to lag(my_xts) that you enter or source() into this session won't     #
    # work correctly.                                                             #
    #                                                                             #
    # All package code is unaffected because it is protected by the R namespace   #
    # mechanism.                                                                  #
    #                                                                             #
    # Set `options(xts.warn_dplyr_breaks_lag = FALSE)` to suppress this warning.  #
    ################################### WARNING ###################################

    Attaching package: 'xts'

    The following objects are masked from 'package:dplyr':

        first, last

    Attaching package: 'PerformanceAnalytics'

    The following object is masked from 'package:graphics':

        legend

    Loading required package: quantmod
    Loading required package: TTR
    >
    > # Forecast objects
    > library(forecast)
    > library(robets)
    > library(fracdiff)
    > library(timeDate)

    Attaching package: 'timeDate'

    The following objects are masked from 'package:PerformanceAnalytics':

        kurtosis, skewness

    > library(tseries)
    >
    > test_check("timetk")
    [ FAIL 1 | WARN 13 | SKIP 0 | PASS 400 ]

    ══ Failed tests ════════════════════════════════════════════════════════════════
    ── Failure ('test-tk_make_timeseries.R:32'): Date Sequences ────────────────────
    `seq_0` not identical to `seq_1`.
    Mean relative difference: 0.000199561

    [ FAIL 1 | WARN 13 | SKIP 0 | PASS 400 ]
    Error: Test failures
    Execution halted

The failure with PortfolioAnalytics was due to errant code making into the tarball even though it was not committed to Git. The code was an experiment updating the tclass attribute on old xts objects.

F- for me.

josh@...: /storage/git/R/xts (master)
$ diff R/tclass.R xts.Rcheck/00_pkg_src/xts/R/tclass.R --color
44a45
>     # no 'tclass' on the index
47,54c48,68
<     tclass <- attr(x, "tclass")
<     if (is.null(tclass)) {
<       tclass <- attr(x, ".indexCLASS")
<     }
<     if (is.null(tclass)) {
<       warning("object does not have a ", sQuote("tclass"), " or ",
<               sQuote(".indexCLASS"), " attribute")
<       tclass <- ""
---
>     tclass_on_object <- attr(x, "tclass")
>     indexCLASS_on_index <- attr(attr(x, "index"), "indexCLASS")
>     indexCLASS_on_object <- attr(x, "indexCLASS")
> 
>     if (is.null(tclass_on_object)) {
>       if (is.null(indexCLASS_on_index)) {
>         if (is.null(indexCLASS_on_object)) {
>           warning("could not find a ", sQuote("tclass"), " or ",
>                   sQuote(".indexCLASS"), " attribute; setting tclass to \"\"")
>           tclass <- ""
>         } else {
>           attr(x, "indexCLASS") <- NULL
>           tclass <- indexCLASS_on_object
>         }
>       } else {
>         attr(attr(x, "index"), "indexCLASS") <- NULL
>         tclass <- indexCLASS_on_index
>       }
>     } else {
>       attr(x, "tclass") <- NULL
>       tclass <- tclass_on_object
56c70,71
<     tclass
---
>     # update 'tclass' attribute on index
>     attr(attr(x, "index"), "tclass") <- tclass