Due Date: 11:59pm, Oct 25

Group Homework

  • You will work with your group to complete this assignment.

  • Upload your html file on RPubs and include the link when you submit your submission files on Collab.

  • Submit your group’s shared .Rmd AND “knitted”.html files on Collab.

  • Note that this html file is now uploaded on RPubs.

Group Homework

  • Your “knitted .html” submission must be created from your “group .Rmd” but be created on your own computer.

  • Confirm this with the following comment included in your submission text box: “Honor Pledge: I have recreated my group submission using using the tools I have installed on my own computer”

  • Name the files with a group name and YOUR name for your submission.

  • Each group member must be able to submit this assignment as created from their own computer. If only some members of the group submit the required files, those group members must additionally provide a supplemental explanation along with their submission as to why other students in their group have not completed this assignment.

Part 1

Part 1: Instruction

  • Use the EuStockMarkets data that contains the daily closing prices of major European stock indices: Germany DAX (Ibis), Switzerland SMI, France CAC, and UK FTSE. Then, create multiple lines that show changes of each index’s daily closing prices over time.

  • Please use function gather from package tidyr to transform the data from a wide to a long format. For more info, refer to our lecture materials on dataformats (i.e., DS3003_dataformat_facets_note.pdf, DS3003_dataformat_facets_code.rmd, or DS3003_dataformat_facets_code.html

  • Use function plot_ly from package plotly to create a line plot.

Part 1: Example

Part 1: Results

library(tidyr) # load tidyr package
library(plotly) # load plotly package

data(EuStockMarkets) # load EuStockMarkets
dat <- as.data.frame(EuStockMarkets) # coerce it to a data frame
dat$time <- time(EuStockMarkets) # add `time` variable

# add your codes

Part 2

Part 2: Instruction

  • Use a dataset in data repositories (e.g., kaggle) that gives the measurements in different conditions like iris data. For more info on iris data, use ?iris.

  • Briefly describe the dataset you’re using for this assignment (e.g., means to access data, context, sample, variables, etc…).

  • Transform the dataset from a wide to a long format. Produce any ggplot where the key variable is used in function facet_grid or facet_wrap.

  • One of the group members will present R codes and plots for Part 2 in class on Oct. 26 (Tue). Please e-mail the instructor with your RPubs link if you’re a presenter by 11:59pm, Oct 25.

Part 2: Data Description

describe your data.

Part 2: Example

  • Here is one example we used in class.

  • You may want to delete this slide when you submit your files.

longiris <- gather(iris, key = flower_att, value = measurement, 
                    Sepal.Length:Petal.Width)
ggplot(longiris, aes(x=Species, y=measurement)) + geom_boxplot() + 
   facet_grid(~ flower_att) + theme_classic()

Part 2: Example

Part 2: Results

# add your codes