library(readr)
## Warning: replacing previous import 'lifecycle::last_warnings' by
## 'rlang::last_warnings' when loading 'tibble'
## Warning: replacing previous import 'ellipsis::check_dots_unnamed' by
## 'rlang::check_dots_unnamed' when loading 'tibble'
## Warning: replacing previous import 'ellipsis::check_dots_used' by
## 'rlang::check_dots_used' when loading 'tibble'
## Warning: replacing previous import 'ellipsis::check_dots_empty' by
## 'rlang::check_dots_empty' when loading 'tibble'
## Warning: replacing previous import 'lifecycle::last_warnings' by
## 'rlang::last_warnings' when loading 'pillar'
## Warning: replacing previous import 'ellipsis::check_dots_unnamed' by
## 'rlang::check_dots_unnamed' when loading 'pillar'
## Warning: replacing previous import 'ellipsis::check_dots_used' by
## 'rlang::check_dots_used' when loading 'pillar'
## Warning: replacing previous import 'ellipsis::check_dots_empty' by
## 'rlang::check_dots_empty' when loading 'pillar'
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.3.2 ✓ dplyr 1.0.2
## ✓ tibble 3.0.4 ✓ stringr 1.4.0
## ✓ tidyr 1.1.2 ✓ forcats 0.5.0
## ✓ purrr 0.3.4
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
big_mac_source_data <- read_csv("big-mac-source-data.csv")
##
## ── Column specification ────────────────────────────────────────────────────────
## cols(
## name = col_character(),
## iso_a3 = col_character(),
## currency_code = col_character(),
## local_price = col_double(),
## dollar_ex = col_double(),
## GDP_dollar = col_double(),
## date = col_date(format = "")
## )
#View(big_mac_source_data)
bm <- big_mac_source_data
bmfixed <- big_mac_source_data %>%
mutate(localprice = round(local_price, 2)) %>%
mutate(dollarex = round(dollar_ex, 2)) %>%
select(name, currency_code, date, localprice, dollarex)
bmfixed
## # A tibble: 1,948 x 5
## name currency_code date localprice dollarex
## <chr> <chr> <date> <dbl> <dbl>
## 1 Argentina ARS 2000-04-01 2.5 1
## 2 Australia AUD 2000-04-01 2.59 1.68
## 3 Brazil BRL 2000-04-01 2.95 1.79
## 4 Britain GBP 2000-04-01 1.9 0.63
## 5 Canada CAD 2000-04-01 2.85 1.47
## 6 Chile CLP 2000-04-01 1260 514
## 7 China CNY 2000-04-01 9.9 8.28
## 8 Czech Republic CZK 2000-04-01 54.4 39.1
## 9 Denmark DKK 2000-04-01 24.8 8.04
## 10 Euro area EUR 2000-04-01 2.56 1.08
## # … with 1,938 more rows
merica <- bmfixed %>%
filter(name == "South Korea")
ggplot(data=merica,
mapping = aes(x = date,
y = localprice,
colour = name)) +
geom_point()
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.