# none my_answers <- rep(0, 5)
Consider the dataframe
created with the following code:
library(tidyverse) my_N <- 100 df <- bind_rows(tibble(ticker = rep('STOCK 1', my_N), ref_date = Sys.Date() + 1:my_N, price = 100 + cumsum(rnorm(my_N))), tibble(ticker = rep('STOCK 2', my_N), ref_date = Sys.Date() + 1:my_N, price = 100 + cumsum(rnorm(my_N))) ) print(df)
Is the dataframe
format long or wide? Explain your answer.
The format is long: we have data stacked for two different stocks. Note that, with the addition of new tickers, the table grows with new lines. New variables can be easily added with new columns.
extype: string
exsolution: r mchoice2string(c(TRUE, FALSE, FALSE, FALSE, FALSE), single = TRUE)
exname: "function 01"
exshuffle: TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.