Last updated on 2025-06-21 15:50:00 CEST.
Package | ERROR | NOTE | OK |
---|---|---|---|
alphavantager | 13 | ||
anomalize | 13 | ||
correlationfunnel | 2 | 11 | |
modeltime | 13 | ||
modeltime.ensemble | 13 | ||
modeltime.resample | 2 | 11 | |
sweep | 4 | 4 | 5 |
tidyquant | 5 | 8 | |
timetk | 6 | 7 |
Current CRAN status: OK: 13
Current CRAN status: OK: 13
Current CRAN status: NOTE: 2, OK: 11
Version: 0.2.0
Check: dependencies in R code
Result: NOTE
Namespace in Imports field not imported from: ‘utils’
All declared Imports should be used.
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc
Current CRAN status: OK: 13
Current CRAN status: OK: 13
Current CRAN status: NOTE: 2, OK: 11
Version: 0.2.3
Check: dependencies in R code
Result: NOTE
Namespaces in Imports field not imported from:
‘crayon’ ‘dials’ ‘glue’ ‘parsnip’
All declared Imports should be used.
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc
Current CRAN status: ERROR: 4, NOTE: 4, OK: 5
Version: 0.2.5
Check: Rd cross-references
Result: NOTE
Found the following Rd file(s) with Rd \link{} targets missing package
anchors:
sw_sweep.Rd: tk_make_future_timeseries
tidiers_bats.Rd: bats, tbats
tidiers_ets.Rd: ets
tidiers_nnetar.Rd: nnetar
Please provide package anchors for all Rd \link{} targets not in the
package itself and the base packages.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-windows-x86_64, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-windows-x86_64
Version: 0.2.5
Check: re-building of vignette outputs
Result: ERROR
Error(s) in re-building vignettes:
...
--- re-building ‘SW00_Introduction_to_sweep.Rmd’ using rmarkdown
Quitting from SW00_Introduction_to_sweep.Rmd:65-74 [unnamed-chunk-4]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NULL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'SW00_Introduction_to_sweep.Rmd' failed with diagnostics:
`data` must be a <data.frame>, or an object coercible by `fortify()`, or
a valid <data.frame>-like object coercible by `as.data.frame()`.
Caused by error in `.prevalidate_data_frame_like_object()`:
! `dim(data)` must return an <integer> of length 2.
--- failed re-building ‘SW00_Introduction_to_sweep.Rmd’
--- re-building ‘SW01_Forecasting_Time_Series_Groups.Rmd’ using rmarkdown
** Processing: /home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/sweep.Rcheck/vign_test/sweep/vignettes/SW01_Forecasting_Time_Series_Groups_files/figure-html/unnamed-chunk-5-1.png
1600x900 pixels, 3x8 bits/pixel, RGB
Input IDAT size = 58101 bytes
Input file size = 58263 bytes
Trying:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 51170
zc = 9 zm = 8 zs = 1 f = 0
zc = 1 zm = 8 zs = 2 f = 0
zc = 9 zm = 8 zs = 3 f = 0
zc = 9 zm = 8 zs = 0 f = 5
zc = 9 zm = 8 zs = 1 f = 5
zc = 1 zm = 8 zs = 2 f = 5
zc = 9 zm = 8 zs = 3 f = 5
Selecting parameters:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 51170
Output IDAT size = 51170 bytes (6931 bytes decrease)
Output file size = 51248 bytes (7015 bytes = 12.04% decrease)
** Processing: /home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/sweep.Rcheck/vign_test/sweep/vignettes/SW01_Forecasting_Time_Series_Groups_files/figure-html/unnamed-chunk-13-1.png
1600x900 pixels, 3x8 bits/pixel, RGB
Input IDAT size = 271738 bytes
Input file size = 272212 bytes
Trying:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 227922
zc = 9 zm = 8 zs = 1 f = 0
zc = 1 zm = 8 zs = 2 f = 0
zc = 9 zm = 8 zs = 3 f = 0
zc = 9 zm = 8 zs = 0 f = 5
zc = 9 zm = 8 zs = 1 f = 5
zc = 1 zm = 8 zs = 2 f = 5
zc = 9 zm = 8 zs = 3 f = 5
Selecting parameters:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 227922
Output IDAT size = 227922 bytes (43816 bytes decrease)
Output file size = 228000 bytes (44212 bytes = 16.24% decrease)
** Processing: /home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/sweep.Rcheck/vign_test/sweep/vignettes/SW01_Forecasting_Time_Series_Groups_files/figure-html/unnamed-chunk-17-1.png
1600x1400 pixels, 3x8 bits/pixel, RGB
Input IDAT size = 262303 bytes
Input file size = 262765 bytes
Trying:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 233931
zc = 9 zm = 8 zs = 1 f = 0
zc = 1 zm = 8 zs = 2 f = 0
zc = 9 zm = 8 zs = 3 f = 0
zc = 9 zm = 8 zs = 0 f = 5
zc = 9 zm = 8 zs = 1 f = 5
zc = 1 zm = 8 zs = 2 f = 5
zc = 9 zm = 8 zs = 3 f = 5
Selecting parameters:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 233931
Output IDAT size = 233931 bytes (28372 bytes decrease)
Output file size = 234009 bytes (28756 bytes = 10.94% decrease)
--- finished re-building ‘SW01_Forecasting_Time_Series_Groups.Rmd’
--- re-building ‘SW02_Forecasting_Multiple_Models.Rmd’ using rmarkdown
Quitting from SW02_Forecasting_Multiple_Models.Rmd:63-63
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `gas_prices_monthly_raw$price`:
! $ operator is invalid for atomic vectors
---
Backtrace:
▆
1. └─is.na(gas_prices_monthly_raw$price) %>% sum()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'SW02_Forecasting_Multiple_Models.Rmd' failed with diagnostics:
$ operator is invalid for atomic vectors
--- failed re-building ‘SW02_Forecasting_Multiple_Models.Rmd’
SUMMARY: processing the following files failed:
‘SW00_Introduction_to_sweep.Rmd’
‘SW02_Forecasting_Multiple_Models.Rmd’
Error: Vignette re-building failed.
Execution halted
Flavor: r-devel-linux-x86_64-debian-clang
Version: 0.2.5
Check: dependencies in R code
Result: NOTE
Namespaces in Imports field not imported from:
‘lubridate’ ‘tidyquant’ ‘tidyr’ ‘tidyverse’
All declared Imports should be used.
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc
Version: 0.2.5
Check: re-building of vignette outputs
Result: ERROR
Error(s) in re-building vignettes:
--- re-building 'SW00_Introduction_to_sweep.Rmd' using rmarkdown
Quitting from SW00_Introduction_to_sweep.Rmd:65-74 [unnamed-chunk-4]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NULL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'SW00_Introduction_to_sweep.Rmd' failed with diagnostics:
`data` must be a <data.frame>, or an object coercible by `fortify()`, or
a valid <data.frame>-like object coercible by `as.data.frame()`.
Caused by error in `.prevalidate_data_frame_like_object()`:
! `dim(data)` must return an <integer> of length 2.
--- failed re-building 'SW00_Introduction_to_sweep.Rmd'
--- re-building 'SW01_Forecasting_Time_Series_Groups.Rmd' using rmarkdown
--- finished re-building 'SW01_Forecasting_Time_Series_Groups.Rmd'
--- re-building 'SW02_Forecasting_Multiple_Models.Rmd' using rmarkdown
Quitting from SW02_Forecasting_Multiple_Models.Rmd:63-63
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `gas_prices_monthly_raw$price`:
! $ operator is invalid for atomic vectors
---
Backtrace:
▆
1. └─is.na(gas_prices_monthly_raw$price) %>% sum()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'SW02_Forecasting_Multiple_Models.Rmd' failed with diagnostics:
$ operator is invalid for atomic vectors
--- failed re-building 'SW02_Forecasting_Multiple_Models.Rmd'
SUMMARY: processing the following files failed:
'SW00_Introduction_to_sweep.Rmd'
'SW02_Forecasting_Multiple_Models.Rmd'
Error: Vignette re-building failed.
Execution halted
Flavors: r-devel-windows-x86_64, r-release-windows-x86_64
Version: 0.2.5
Check: re-building of vignette outputs
Result: ERROR
Error(s) in re-building vignettes:
...
--- re-building ‘SW00_Introduction_to_sweep.Rmd’ using rmarkdown
Quitting from SW00_Introduction_to_sweep.Rmd:65-74 [unnamed-chunk-4]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NULL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'SW00_Introduction_to_sweep.Rmd' failed with diagnostics:
`data` must be a <data.frame>, or an object coercible by `fortify()`, or
a valid <data.frame>-like object coercible by `as.data.frame()`.
Caused by error in `.prevalidate_data_frame_like_object()`:
! `dim(data)` must return an <integer> of length 2.
--- failed re-building ‘SW00_Introduction_to_sweep.Rmd’
--- re-building ‘SW01_Forecasting_Time_Series_Groups.Rmd’ using rmarkdown
** Processing: /home/hornik/tmp/R.check/r-patched-gcc/Work/PKGS/sweep.Rcheck/vign_test/sweep/vignettes/SW01_Forecasting_Time_Series_Groups_files/figure-html/unnamed-chunk-5-1.png
1600x900 pixels, 3x8 bits/pixel, RGB
Input IDAT size = 58101 bytes
Input file size = 58263 bytes
Trying:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 51170
zc = 9 zm = 8 zs = 1 f = 0
zc = 1 zm = 8 zs = 2 f = 0
zc = 9 zm = 8 zs = 3 f = 0
zc = 9 zm = 8 zs = 0 f = 5
zc = 9 zm = 8 zs = 1 f = 5
zc = 1 zm = 8 zs = 2 f = 5
zc = 9 zm = 8 zs = 3 f = 5
Selecting parameters:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 51170
Output IDAT size = 51170 bytes (6931 bytes decrease)
Output file size = 51248 bytes (7015 bytes = 12.04% decrease)
** Processing: /home/hornik/tmp/R.check/r-patched-gcc/Work/PKGS/sweep.Rcheck/vign_test/sweep/vignettes/SW01_Forecasting_Time_Series_Groups_files/figure-html/unnamed-chunk-13-1.png
1600x900 pixels, 3x8 bits/pixel, RGB
Input IDAT size = 271738 bytes
Input file size = 272212 bytes
Trying:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 227922
zc = 9 zm = 8 zs = 1 f = 0
zc = 1 zm = 8 zs = 2 f = 0
zc = 9 zm = 8 zs = 3 f = 0
zc = 9 zm = 8 zs = 0 f = 5
zc = 9 zm = 8 zs = 1 f = 5
zc = 1 zm = 8 zs = 2 f = 5
zc = 9 zm = 8 zs = 3 f = 5
Selecting parameters:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 227922
Output IDAT size = 227922 bytes (43816 bytes decrease)
Output file size = 228000 bytes (44212 bytes = 16.24% decrease)
** Processing: /home/hornik/tmp/R.check/r-patched-gcc/Work/PKGS/sweep.Rcheck/vign_test/sweep/vignettes/SW01_Forecasting_Time_Series_Groups_files/figure-html/unnamed-chunk-17-1.png
1600x1400 pixels, 3x8 bits/pixel, RGB
Input IDAT size = 262303 bytes
Input file size = 262765 bytes
Trying:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 233931
zc = 9 zm = 8 zs = 1 f = 0
zc = 1 zm = 8 zs = 2 f = 0
zc = 9 zm = 8 zs = 3 f = 0
zc = 9 zm = 8 zs = 0 f = 5
zc = 9 zm = 8 zs = 1 f = 5
zc = 1 zm = 8 zs = 2 f = 5
zc = 9 zm = 8 zs = 3 f = 5
Selecting parameters:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 233931
Output IDAT size = 233931 bytes (28372 bytes decrease)
Output file size = 234009 bytes (28756 bytes = 10.94% decrease)
--- finished re-building ‘SW01_Forecasting_Time_Series_Groups.Rmd’
--- re-building ‘SW02_Forecasting_Multiple_Models.Rmd’ using rmarkdown
Quitting from SW02_Forecasting_Multiple_Models.Rmd:63-63
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `gas_prices_monthly_raw$price`:
! $ operator is invalid for atomic vectors
---
Backtrace:
▆
1. └─is.na(gas_prices_monthly_raw$price) %>% sum()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'SW02_Forecasting_Multiple_Models.Rmd' failed with diagnostics:
$ operator is invalid for atomic vectors
--- failed re-building ‘SW02_Forecasting_Multiple_Models.Rmd’
SUMMARY: processing the following files failed:
‘SW00_Introduction_to_sweep.Rmd’
‘SW02_Forecasting_Multiple_Models.Rmd’
Error: Vignette re-building failed.
Execution halted
Flavor: r-patched-linux-x86_64
Current CRAN status: ERROR: 5, OK: 8
Version: 1.0.11
Check: examples
Result: ERROR
Running examples in ‘tidyquant-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: tq_mutate
> ### Title: Mutates quantitative data
> ### Aliases: tq_mutate tq_mutate_ tq_mutate_xy tq_mutate_xy_
> ### tq_mutate_fun_options tq_transmute tq_transmute_ tq_transmute_xy
> ### tq_transmute_xy_ tq_transmute_fun_options
>
> ### ** Examples
>
> # Load libraries
> library(dplyr)
######################### Warning from 'xts' package ##########################
# #
# 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 type or #
# source() into this session won't work correctly. #
# #
# Use stats::lag() to make sure you're not using dplyr::lag(), or you can add #
# conflictRules('dplyr', exclude = 'lag') to your .Rprofile to stop #
# dplyr from breaking base R's lag() function. #
# #
# Code in packages is not affected. It's protected by R's namespace mechanism #
# Set `options(xts.warn_dplyr_breaks_lag = FALSE)` to suppress this warning. #
# #
###############################################################################
Attaching package: ‘dplyr’
The following objects are masked from ‘package:xts’:
first, last
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
>
> ##### Basic Functionality
>
> fb_stock_prices <- tidyquant::FANG %>%
+ filter(symbol == "META") %>%
+ filter(
+ date >= "2016-01-01",
+ date <= "2016-12-31"
+ )
>
> goog_stock_prices <- FANG %>%
+ filter(symbol == "GOOG") %>%
+ filter(
+ date >= "2016-01-01",
+ date <= "2016-12-31"
+ )
>
> # Example 1: Return logarithmic daily returns using periodReturn()
> fb_stock_prices %>%
+ tq_mutate(select = close, mutate_fun = periodReturn,
+ period = "daily", type = "log")
# A tibble: 252 × 9
symbol date open high low close volume adjusted daily.returns
<chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 META 2016-01-04 102. 102. 99.8 102. 37912400 102. 0
2 META 2016-01-05 103. 104. 102. 103. 23258200 103. 0.00498
3 META 2016-01-06 101. 104. 101. 103. 25096200 103. 0.00233
4 META 2016-01-07 100. 101. 97.3 97.9 45172900 97.9 -0.0503
5 META 2016-01-08 99.9 100. 97.0 97.3 35402300 97.3 -0.00604
6 META 2016-01-11 97.9 98.6 95.4 97.5 29932400 97.5 0.00185
7 META 2016-01-12 99 100. 97.6 99.4 28395400 99.4 0.0189
8 META 2016-01-13 101. 101. 95.2 95.4 33410600 95.4 -0.0404
9 META 2016-01-14 95.8 98.9 92.4 98.4 48658600 98.4 0.0302
10 META 2016-01-15 94.0 96.4 93.5 95.0 45935600 95.0 -0.0352
# ℹ 242 more rows
>
> # Example 2: Use tq_mutate_xy to use functions with two columns required
> fb_stock_prices %>%
+ tq_mutate_xy(x = close, y = volume, mutate_fun = EVWMA,
+ col_rename = "EVWMA")
# A tibble: 252 × 9
symbol date open high low close volume adjusted EVWMA
<chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 META 2016-01-04 102. 102. 99.8 102. 37912400 102. NA
2 META 2016-01-05 103. 104. 102. 103. 23258200 103. NA
3 META 2016-01-06 101. 104. 101. 103. 25096200 103. NA
4 META 2016-01-07 100. 101. 97.3 97.9 45172900 97.9 NA
5 META 2016-01-08 99.9 100. 97.0 97.3 35402300 97.3 NA
6 META 2016-01-11 97.9 98.6 95.4 97.5 29932400 97.5 NA
7 META 2016-01-12 99 100. 97.6 99.4 28395400 99.4 NA
8 META 2016-01-13 101. 101. 95.2 95.4 33410600 95.4 NA
9 META 2016-01-14 95.8 98.9 92.4 98.4 48658600 98.4 NA
10 META 2016-01-15 94.0 96.4 93.5 95.0 45935600 95.0 95.0
# ℹ 242 more rows
>
> # Example 3: Using tq_mutate to work with non-OHLC data
> tq_get("DCOILWTICO", get = "economic.data") %>%
+ tq_mutate(select = price, mutate_fun = lag.xts, k = 1, na.pad = TRUE)
Warning: x = 'DCOILWTICO', get = 'economic.data': Error in getSymbols.FRED(Symbols = "DCOILWTICO", env = <environment>, : Unable to import “DCOILWTICO”.
cannot open the connection
Error in tq_mutate_.default(data = data, select = lazyeval::expr_text(select), :
data must be a tibble or data.frame object
Calls: %>% -> tq_mutate -> tq_mutate_ -> tq_mutate_.default
Execution halted
Flavors: r-devel-linux-x86_64-debian-clang, r-patched-linux-x86_64
Version: 1.0.11
Check: tests
Result: ERROR
Running ‘testthat.R’ [13s/25s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(tidyquant)
── Attaching core tidyquant packages ─────────────────────── tidyquant 1.0.11 ──
✔ PerformanceAnalytics 2.0.8 ✔ quantmod 0.4.27
✔ TTR 0.24.4 ✔ xts 0.14.1
── Conflicts ────────────────────────────────────────── tidyquant_conflicts() ──
✖ zoo::as.Date() masks base::as.Date()
✖ zoo::as.Date.numeric() masks base::as.Date.numeric()
✖ PerformanceAnalytics::legend() masks graphics::legend()
✖ quantmod::summary() masks base::summary()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
>
> test_check("tidyquant")
[ FAIL 4 | WARN 2 | SKIP 4 | PASS 63 ]
══ Skipped tests (4) ═══════════════════════════════════════════════════════════
• On CRAN (4): 'test-index-tq_index.R:16:5', 'test-index_tq_exchange.R:18:5',
'test-tq_portfolio.R:4:1', 'test-tq_transmute.R:2:1'
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-tq_get_economic_data.R:20:5'): Test returns tibble with correct rows and columns. ──
`test1` inherits from `'logical'` not `'character'`.
── Failure ('test-tq_get_economic_data.R:21:5'): Test returns tibble with correct rows and columns. ──
`test2` inherits from `'logical'` not `'character'`.
── Failure ('test-tq_get_economic_data.R:25:5'): Test returns tibble with correct rows and columns. ──
nrow(test1) not equal to 6.
target is NULL, current is numeric
── Failure ('test-tq_get_economic_data.R:27:5'): Test returns tibble with correct rows and columns. ──
ncol(test1) not equal to 3.
target is NULL, current is numeric
[ FAIL 4 | WARN 2 | SKIP 4 | PASS 63 ]
Error: Test failures
Execution halted
Flavor: r-devel-linux-x86_64-debian-clang
Version: 1.0.11
Check: examples
Result: ERROR
Running examples in ‘tidyquant-Ex.R’ failed
The error most likely occurred in:
> ### Name: tq_mutate
> ### Title: Mutates quantitative data
> ### Aliases: tq_mutate tq_mutate_ tq_mutate_xy tq_mutate_xy_
> ### tq_mutate_fun_options tq_transmute tq_transmute_ tq_transmute_xy
> ### tq_transmute_xy_ tq_transmute_fun_options
>
> ### ** Examples
>
> # Load libraries
> library(dplyr)
######################### Warning from 'xts' package ##########################
# #
# 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 type or #
# source() into this session won't work correctly. #
# #
# Use stats::lag() to make sure you're not using dplyr::lag(), or you can add #
# conflictRules('dplyr', exclude = 'lag') to your .Rprofile to stop #
# dplyr from breaking base R's lag() function. #
# #
# Code in packages is not affected. It's protected by R's namespace mechanism #
# Set `options(xts.warn_dplyr_breaks_lag = FALSE)` to suppress this warning. #
# #
###############################################################################
Attaching package: ‘dplyr’
The following objects are masked from ‘package:xts’:
first, last
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
>
> ##### Basic Functionality
>
> fb_stock_prices <- tidyquant::FANG %>%
+ filter(symbol == "META") %>%
+ filter(
+ date >= "2016-01-01",
+ date <= "2016-12-31"
+ )
>
> goog_stock_prices <- FANG %>%
+ filter(symbol == "GOOG") %>%
+ filter(
+ date >= "2016-01-01",
+ date <= "2016-12-31"
+ )
>
> # Example 1: Return logarithmic daily returns using periodReturn()
> fb_stock_prices %>%
+ tq_mutate(select = close, mutate_fun = periodReturn,
+ period = "daily", type = "log")
# A tibble: 252 × 9
symbol date open high low close volume adjusted daily.returns
<chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 META 2016-01-04 102. 102. 99.8 102. 37912400 102. 0
2 META 2016-01-05 103. 104. 102. 103. 23258200 103. 0.00498
3 META 2016-01-06 101. 104. 101. 103. 25096200 103. 0.00233
4 META 2016-01-07 100. 101. 97.3 97.9 45172900 97.9 -0.0503
5 META 2016-01-08 99.9 100. 97.0 97.3 35402300 97.3 -0.00604
6 META 2016-01-11 97.9 98.6 95.4 97.5 29932400 97.5 0.00185
7 META 2016-01-12 99 100. 97.6 99.4 28395400 99.4 0.0189
8 META 2016-01-13 101. 101. 95.2 95.4 33410600 95.4 -0.0404
9 META 2016-01-14 95.8 98.9 92.4 98.4 48658600 98.4 0.0302
10 META 2016-01-15 94.0 96.4 93.5 95.0 45935600 95.0 -0.0352
# ℹ 242 more rows
>
> # Example 2: Use tq_mutate_xy to use functions with two columns required
> fb_stock_prices %>%
+ tq_mutate_xy(x = close, y = volume, mutate_fun = EVWMA,
+ col_rename = "EVWMA")
# A tibble: 252 × 9
symbol date open high low close volume adjusted EVWMA
<chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 META 2016-01-04 102. 102. 99.8 102. 37912400 102. NA
2 META 2016-01-05 103. 104. 102. 103. 23258200 103. NA
3 META 2016-01-06 101. 104. 101. 103. 25096200 103. NA
4 META 2016-01-07 100. 101. 97.3 97.9 45172900 97.9 NA
5 META 2016-01-08 99.9 100. 97.0 97.3 35402300 97.3 NA
6 META 2016-01-11 97.9 98.6 95.4 97.5 29932400 97.5 NA
7 META 2016-01-12 99 100. 97.6 99.4 28395400 99.4 NA
8 META 2016-01-13 101. 101. 95.2 95.4 33410600 95.4 NA
9 META 2016-01-14 95.8 98.9 92.4 98.4 48658600 98.4 NA
10 META 2016-01-15 94.0 96.4 93.5 95.0 45935600 95.0 95.0
# ℹ 242 more rows
>
> # Example 3: Using tq_mutate to work with non-OHLC data
> tq_get("DCOILWTICO", get = "economic.data") %>%
+ tq_mutate(select = price, mutate_fun = lag.xts, k = 1, na.pad = TRUE)
Warning: x = 'DCOILWTICO', get = 'economic.data': Error in getSymbols.FRED(Symbols = "DCOILWTICO", env = <environment>, : Unable to import “DCOILWTICO”.
cannot open the connection
Error in tq_mutate_.default(data = data, select = lazyeval::expr_text(select), :
data must be a tibble or data.frame object
Calls: %>% -> tq_mutate -> tq_mutate_ -> tq_mutate_.default
Execution halted
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-windows-x86_64, r-release-windows-x86_64
Version: 1.0.11
Check: tests
Result: ERROR
Running 'testthat.R' [21s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(tidyquant)
── Attaching core tidyquant packages ─────────────────────── tidyquant 1.0.11 ──
✔ PerformanceAnalytics 2.0.8 ✔ quantmod 0.4.27
✔ TTR 0.24.4 ✔ xts 0.14.1
── Conflicts ────────────────────────────────────────── tidyquant_conflicts() ──
✖ zoo::as.Date() masks base::as.Date()
✖ zoo::as.Date.numeric() masks base::as.Date.numeric()
✖ PerformanceAnalytics::legend() masks graphics::legend()
✖ quantmod::summary() masks base::summary()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
>
> test_check("tidyquant")
[ FAIL 4 | WARN 2 | SKIP 5 | PASS 62 ]
══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• On CRAN (4): 'test-index-tq_index.R:16:5', 'test-index_tq_exchange.R:18:5',
'test-tq_portfolio.R:4:1', 'test-tq_transmute.R:2:1'
• On Windows (1): 'test-index_tq_exchange.R:32:5'
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-tq_get_economic_data.R:20:5'): Test returns tibble with correct rows and columns. ──
`test1` inherits from `'logical'` not `'character'`.
── Failure ('test-tq_get_economic_data.R:21:5'): Test returns tibble with correct rows and columns. ──
`test2` inherits from `'logical'` not `'character'`.
── Failure ('test-tq_get_economic_data.R:25:5'): Test returns tibble with correct rows and columns. ──
nrow(test1) not equal to 6.
target is NULL, current is numeric
── Failure ('test-tq_get_economic_data.R:27:5'): Test returns tibble with correct rows and columns. ──
ncol(test1) not equal to 3.
target is NULL, current is numeric
[ FAIL 4 | WARN 2 | SKIP 5 | PASS 62 ]
Error: Test failures
Execution halted
Flavor: r-devel-windows-x86_64
Version: 1.0.11
Check: tests
Result: ERROR
Running ‘testthat.R’ [12s/16s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(tidyquant)
── Attaching core tidyquant packages ─────────────────────── tidyquant 1.0.11 ──
✔ PerformanceAnalytics 2.0.8 ✔ quantmod 0.4.27
✔ TTR 0.24.4 ✔ xts 0.14.1
── Conflicts ────────────────────────────────────────── tidyquant_conflicts() ──
✖ zoo::as.Date() masks base::as.Date()
✖ zoo::as.Date.numeric() masks base::as.Date.numeric()
✖ PerformanceAnalytics::legend() masks graphics::legend()
✖ quantmod::summary() masks base::summary()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
>
> test_check("tidyquant")
[ FAIL 4 | WARN 2 | SKIP 4 | PASS 63 ]
══ Skipped tests (4) ═══════════════════════════════════════════════════════════
• On CRAN (4): 'test-index-tq_index.R:16:5', 'test-index_tq_exchange.R:18:5',
'test-tq_portfolio.R:4:1', 'test-tq_transmute.R:2:1'
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-tq_get_economic_data.R:20:5'): Test returns tibble with correct rows and columns. ──
`test1` inherits from `'logical'` not `'character'`.
── Failure ('test-tq_get_economic_data.R:21:5'): Test returns tibble with correct rows and columns. ──
`test2` inherits from `'logical'` not `'character'`.
── Failure ('test-tq_get_economic_data.R:25:5'): Test returns tibble with correct rows and columns. ──
nrow(test1) not equal to 6.
target is NULL, current is numeric
── Failure ('test-tq_get_economic_data.R:27:5'): Test returns tibble with correct rows and columns. ──
ncol(test1) not equal to 3.
target is NULL, current is numeric
[ FAIL 4 | WARN 2 | SKIP 4 | PASS 63 ]
Error: Test failures
Execution halted
Flavor: r-patched-linux-x86_64
Version: 1.0.11
Check: tests
Result: ERROR
Running 'testthat.R' [20s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(tidyquant)
── Attaching core tidyquant packages ─────────────────────── tidyquant 1.0.11 ──
✔ PerformanceAnalytics 2.0.8 ✔ quantmod 0.4.27
✔ TTR 0.24.4 ✔ xts 0.14.1
── Conflicts ────────────────────────────────────────── tidyquant_conflicts() ──
✖ zoo::as.Date() masks base::as.Date()
✖ zoo::as.Date.numeric() masks base::as.Date.numeric()
✖ PerformanceAnalytics::legend() masks graphics::legend()
✖ quantmod::summary() masks base::summary()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
>
> test_check("tidyquant")
[ FAIL 4 | WARN 2 | SKIP 5 | PASS 62 ]
══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• On CRAN (4): 'test-index-tq_index.R:16:5', 'test-index_tq_exchange.R:18:5',
'test-tq_portfolio.R:4:1', 'test-tq_transmute.R:2:1'
• On Windows (1): 'test-index_tq_exchange.R:32:5'
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-tq_get_economic_data.R:20:5'): Test returns tibble with correct rows and columns. ──
`test1` inherits from `'logical'` not `'character'`.
── Failure ('test-tq_get_economic_data.R:21:5'): Test returns tibble with correct rows and columns. ──
`test2` inherits from `'logical'` not `'character'`.
── Failure ('test-tq_get_economic_data.R:25:5'): Test returns tibble with correct rows and columns. ──
nrow(test1) not equal to 6.
target is NULL, current is numeric
── Failure ('test-tq_get_economic_data.R:27:5'): Test returns tibble with correct rows and columns. ──
ncol(test1) not equal to 3.
target is NULL, current is numeric
[ FAIL 4 | WARN 2 | SKIP 5 | PASS 62 ]
Error: Test failures
Execution halted
Flavor: r-release-windows-x86_64
Current CRAN status: NOTE: 6, OK: 7
Version: 2.9.0
Check: Rd cross-references
Result: NOTE
Found the following Rd file(s) with Rd \link{} targets missing package
anchors:
parse_date2.Rd: anytime, anydate
step_box_cox.Rd: selections
step_diff.Rd: step_naomit, selections
step_log_interval.Rd: selections
step_ts_clean.Rd: selections
step_ts_impute.Rd: selections
Please provide package anchors for all Rd \link{} targets not in the
package itself and the base packages.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-windows-x86_64, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-windows-x86_64