Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `data.. = purrr::map(...)`.
Caused by warning:
! x = '-', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "-", env = <environment>, verbose = FALSE, : Unable to import "-".
cannot open the connection
Removing -.
?as_tsibble
Help on topic 'as_tsibble' was found in the following packages:
Package Library
tsibble /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
fable /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
feasts /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
fabletools /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
Using the first match ...
df_daily<-tq_get(x ="PG", get ="stock.prices", from ="1992-01-01")PG_data_monthly<-df_daily%>%mutate(month =yearmonth(date))%>%group_by(month)%>%summarise(adjusted =mean(adjusted))%>%as_tsibble(index =month)write.csv(x =PG_data_monthly, file ="PG_monthly_data.csv")