Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: type_convert() only converts columns of type 'character'. #202

Open
mdancho84 opened this issue Aug 15, 2021 · 1 comment
Open

Comments

@mdancho84
Copy link
Collaborator

Warning from various mapped functions. Looks to be not an issue, but annoying.

library(tidyquant)
library(tidyverse)

Ra <- c("AAPL", "GOOG", "NFLX") %>%
    tq_get(get  = "stock.prices",
           from = "2010-01-01",
           to   = "2015-12-31") %>%
    group_by(symbol) %>%
    tq_transmute(select     = adjusted, 
                 mutate_fun = periodReturn, 
                 period     = "monthly", 
                 col_rename = "Ra")
#> Registered S3 method overwritten by 'tune':
#>   method                   from   
#>   required_pkgs.model_spec parsnip
#> Warning: `type_convert()` only converts columns of type 'character'.
#> - `df` has no columns of type 'character'
#> Warning: `type_convert()` only converts columns of type 'character'.
#> - `df` has no columns of type 'character'

#> Warning: `type_convert()` only converts columns of type 'character'.
#> - `df` has no columns of type 'character'

#> Warning: `type_convert()` only converts columns of type 'character'.
#> - `df` has no columns of type 'character'

#> Warning: `type_convert()` only converts columns of type 'character'.
#> - `df` has no columns of type 'character'

#> Warning: `type_convert()` only converts columns of type 'character'.
#> - `df` has no columns of type 'character'
Ra
#> # A tibble: 216 x 3
#> # Groups:   symbol [3]
#>    symbol date            Ra
#>    <chr>  <date>       <dbl>
#>  1 AAPL   2010-01-29 -0.103 
#>  2 AAPL   2010-02-26  0.0654
#>  3 AAPL   2010-03-31  0.148 
#>  4 AAPL   2010-04-30  0.111 
#>  5 AAPL   2010-05-28 -0.0161
#>  6 AAPL   2010-06-30 -0.0208
#>  7 AAPL   2010-07-30  0.0227
#>  8 AAPL   2010-08-31 -0.0550
#>  9 AAPL   2010-09-30  0.167 
#> 10 AAPL   2010-10-29  0.0607
#> # ... with 206 more rows

Created on 2021-08-15 by the reprex package (v2.0.0)

@jarodmeng
Copy link

I bumped into this and those warnings look much more scary than they really are.

I think this is related to tidyverse/readr#1020 and tidyverse/readr#1019. The warnings pop up in tk_tbl.zoo() in the timetk package. It should be a simple fix there to check the input fed into readr::type_convert(). I will create a PR in timetk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants