- using R Under development (unstable) (2025-06-19 r88329)
- using platform: x86_64-pc-linux-gnu
- R was compiled by
clang version 20.1.7
flang version 20.1.7
- running under: Fedora Linux 42 (Workstation Edition)
- using session charset: UTF-8
- using option ‘--no-stop-on-test-error’
- checking for file ‘tidyquant/DESCRIPTION’ ... OK
- checking extension type ... Package
- this is package ‘tidyquant’ version ‘1.0.11’
- package encoding: UTF-8
- checking package namespace information ... OK
- checking package dependencies ... INFO
Imports includes 24 non-default packages.
Importing from so many packages makes the package vulnerable to any of
them becoming unavailable. Move as many as possible to Suggests and
use conditionally.
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking whether package ‘tidyquant’ can be installed ... [20s/62s] OK
See the install log for details.
- checking installed package size ... OK
- checking package directory ... OK
- checking ‘build’ directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... OK
- checking whether the package can be loaded with stated dependencies ... OK
- checking whether the package can be unloaded cleanly ... OK
- checking whether the namespace can be loaded with stated dependencies ... OK
- checking whether the namespace can be unloaded cleanly ... OK
- checking loading without being on the library search path ... [4s/10s] OK
- checking whether startup messages can be suppressed ... [4s/12s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [28s/68s] OK
- checking Rd files ... OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of ‘data’ directory ... OK
- checking data for non-ASCII characters ... OK
- checking LazyData ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking R/sysdata.rda ... OK
- checking installed files from ‘inst/doc’ ... OK
- checking files in ‘vignettes’ ... OK
- checking examples ... [19s/110s] 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
- checking for unstated dependencies in ‘tests’ ... OK
- checking tests ... [17s/48s] OK
Running ‘testthat.R’ [17s/48s]
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... OK
- checking PDF version of manual ... [12s/24s] OK
- checking HTML version of manual ... OK
- checking for non-standard things in the check directory ... OK
- checking for detritus in the temp directory ... OK
- DONE
Status: 1 ERROR