Publications by Michael Ripley

Quiz 1 makeup

04.05.2020

Use the given code below to answer the questions. ## Load package library(tidyverse) # for cleaning, plotting, etc library(tidyquant) # for financial analysis ## Import data stocks <- tq_get("AAPL", get = "stock.prices", from = "2016-01-01") stocks ## Visualize stocks %>% ggplot(aes(x = date, y = close)) + geom_line() Q1 Import Microsoft s...

2452 sym R (1624 sym/6 pcs) 2 img

quiz1-redo

03.05.2020

Use the given code below to answer the questions. ## Load package library(tidyverse) # for cleaning, plotting, etc library(tidyquant) # for financial analysis ## Import data stocks <- tq_get("AAPL", get = "stock.prices", from = "2016-01-01") stocks ## Visualize stocks %>% ggplot(aes(x = date, y = adjusted)) + geom_line() Q1 Import Netflix ...

2152 sym R (671 sym/4 pcs) 2 img

Tidytuesday

26.04.2020

Choose one of David Robinson’s tidytuesday screencasts, watch the video, and summarise. https://www.youtube.com/channel/UCeiiqmVK07qhY-wvg3IZiZQ Instructions You must follow the instructions below to get credits for this assignment. Read the document posted in Moodle before answering the following questions. Write in your own words. Multiple ...

4794 sym

Quiz 4

21.04.2020

Make sure to include the unit of the values whenever appropriate. Q1 Build a regression model to predict life expectancy using gdp per capita. Hint: The variables are available in the gapminder data set from the gapminder package. Note that the data set and package both have the same name, gapminder. library(tidyverse) options(scipen=999) data(...

2309 sym R (1817 sym/2 pcs)

Mosaic plot

25.03.2020

In this exercise you will learn to visualize the pairwise relationships between a set of quantitative variables. To this end, you will make your own note of 8.5 Mosaic plots from Data Visualization with R. Mosaic charts can display the relationship between categorical variables using: rectangles whose areas represent the proportion of cases for ...

2144 sym 3 img

Quiz 2

04.03.2020

# Load packages library(tidyquant) library(tidyverse) # Import stock prices stock_prices <- tq_get(c("WMT", "TGT", "AMZN"), get = "stock.prices", from = "2020-01-01") # Calculate daily returns stock_returns <- stock_prices %>% group_by(symbol) %>% tq_mutate(select = adjusted, mutate_fun = periodReturn, period = "daily") stock_retur...

1818 sym R (3095 sym/10 pcs) 4 img

Bivariate Graphs

26.02.2020

In this exercise you will learn to plot data using the ggplot2 package. To answer the questions below, use Chapter 4.3 Categorical vs. Quantitative Data Visualization with R. ## # A tibble: 74 x 9 ## # Groups: symbol [2] ## symbol date open high low close volume adjusted daily.returns ## <chr> <date> <dbl> <dbl> <dbl> <d...

1400 sym R (1147 sym/2 pcs) 5 img

Introduction to ggplot2

24.02.2020

In this exercise you will learn to plot data using the ggplot2 package. To answer the questions below, use Chapter 4.3 Categorical vs. Quantitative Data Visualization with R. # Load packages library(tidyquant) ## Loading required package: lubridate ## ## Attaching package: 'lubridate' ## The following object is masked from 'package:base': ## #...

1134 sym R (4483 sym/30 pcs) 6 img

Clean data

19.02.2020

In this exercise you will learn to clean data using the dplyr package. To this end, you will follow through the codes in one of our e-texts, Data Visualization with R. The given example code below is from Chapter 1.2 Cleaning data. ## # A tibble: 87 x 13 ## name height mass hair_color skin_color eye_color birth_year gender ## <chr> <int>...

986 sym R (3087 sym/8 pcs)

Quiz 1

10.02.2020

Use the given code below to answer the questions. ## # A tibble: 1,032 x 7 ## date open high low close volume adjusted ## <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 2016-01-04 103. 105. 102 105. 67649400 98.2 ## 2 2016-01-05 106. 106. 102. 103. 55791000 95.8 ## 3 2016-01-06 101. 102. 99.9 10...

2061 sym R (2276 sym/3 pcs) 2 img