Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
library(patchwork)library(tidyquant)
Loading required package: PerformanceAnalytics
Loading required package: xts
Loading required package: zoo
Attaching package: 'zoo'
The following object is masked from 'package:tsibble':
index
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
######################### 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: 'xts'
The following objects are masked from 'package:dplyr':
first, last
Attaching package: 'PerformanceAnalytics'
The following object is masked from 'package:fpp3':
prices
The following object is masked from 'package:graphics':
legend
Loading required package: quantmod
Loading required package: TTR
Registered S3 method overwritten by 'quantmod':
method from
as.zoo.data.frame zoo
Attaching package: 'tidyquant'
The following object is masked from 'package:fable':
VAR
?aus_accommodation
starting httpd help server ... done
aus_accommodation
# A tsibble: 592 x 5 [1Q]
# Key: State [8]
Date State Takings Occupancy CPI
<qtr> <chr> <dbl> <dbl> <dbl>
1 1998 Q1 Australian Capital Territory 24.3 65 67
2 1998 Q2 Australian Capital Territory 22.3 59 67.4
3 1998 Q3 Australian Capital Territory 22.5 58 67.5
4 1998 Q4 Australian Capital Territory 24.4 59 67.8
5 1999 Q1 Australian Capital Territory 23.7 58 67.8
6 1999 Q2 Australian Capital Territory 25.4 61 68.1
7 1999 Q3 Australian Capital Territory 28.2 66 68.7
8 1999 Q4 Australian Capital Territory 25.8 60 69.1
9 2000 Q1 Australian Capital Territory 27.3 60.9 69.7
10 2000 Q2 Australian Capital Territory 30.1 64.7 70.2
# ℹ 582 more rows
aus_accommodation |>distinct(State)
# A tibble: 8 × 1
State
<chr>
1 Australian Capital Territory
2 New South Wales
3 Northern Territory
4 Queensland
5 South Australia
6 Tasmania
7 Victoria
8 Western Australia
tas <-aus_accommodation |>filter(State =="Tasmania") |>#select(Date, Takings:CPI)select(-c(State,CPI)) |>mutate('Año union n°1'=1 ) |> janitor::clean_names() tas
stocks_data |>ggplot(aes(x = date, y = close, color = symbol))+theme_dark()+geom_line()
stocks_data |>ggplot(aes(x = date, open = open, high = high, low = low, close = close))+theme_dark()+geom_candlestick()+facet_wrap(~ symbol, ncol=2)
Warning: The following aesthetics were dropped during statistical transformation: open,
high, low, close
ℹ This can happen when ggplot fails to infer the correct grouping structure in
the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
variable into a factor?
The following aesthetics were dropped during statistical transformation: open,
high, low, close
ℹ This can happen when ggplot fails to infer the correct grouping structure in
the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
variable into a factor?
The following aesthetics were dropped during statistical transformation: open,
high, low, close
ℹ This can happen when ggplot fails to infer the correct grouping structure in
the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
variable into a factor?
Warning: The following aesthetics were dropped during statistical transformation: x,
open, high, low, close
ℹ This can happen when ggplot fails to infer the correct grouping structure in
the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
variable into a factor?
The following aesthetics were dropped during statistical transformation: x,
open, high, low, close
ℹ This can happen when ggplot fails to infer the correct grouping structure in
the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
variable into a factor?
The following aesthetics were dropped during statistical transformation: x,
open, high, low, close
ℹ This can happen when ggplot fails to infer the correct grouping structure in
the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
variable into a factor?
Warning: Using the `size` aesthetic in this geom was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` in the `default_aes` field and elsewhere instead.