stevecondylios / priceR

Economics and Pricing in R
https://stevecondylios.github.io/priceR/
Other
59 stars 7 forks source link

examples do not run due to date type issue #52

Closed pcias closed 1 year ago

pcias commented 1 year ago

this example from the package:

library(dplyr)

sales_transactions <- tibble( local_price = c(100, 80, 9200, 90), local_currency = c("USD", "EUR", "JPY", "USD"), final_currency = c("EUR", "USD", "USD", "JPY"), date_transaction = lubridate::ymd(c(20200601, 20200609, 20200614, 20200623)) )

Some made-up sales transactions of different values and currencies

sales_transactions %>% mutate( converted_price = convert_currencies( price_start = local_price, from = local_currency, to = final_currency, date = date_transaction ) )

returns:

sales_transactions %>%

  • mutate(
  • converted_price = convert_currencies .... [TRUNCATED] Error in mutate(): ℹ In argument: converted_price = convert_currencies(...). Caused by error in dplyr::semi_join(): ! Can't join x$date with y$date due to incompatible types. ℹ x$date is a . ℹ y$date is a .
stevecondylios commented 1 year ago

Thanks for reporting. This is a duplicate of https://github.com/stevecondylios/priceR/issues/49 and has been fixed in priceR version 1.0.1 on GitHub. It can be installed like so

devtools::install_github("stevecondylios/priceR")

I have submitted this package version to CRAN and will hopefully be live on CRAN soon.