Publications by Joey Campbell

sepuni26_demo

13.03.2020

suppressPackageStartupMessages(library("tidyverse")) package 㤼㸱tidyverse㤼㸲 was built under R version 3.6.3 1. What do the extra and fill arguments do in separate()? Experiment with the various options for the following two toy datasets. tibble(x = c("a,b,c", "d,e,f,g", "h,i,j")) %>% separate(x, c("one", "two", "three")) Expected 3 pie...

8326 sym R (1859 sym/20 pcs)

pivoting25_demo

13.03.2020

suppressPackageStartupMessages(library("tidyverse")) 1. Why are pivot_longer() and pivot_wider() not perfectly symmetrical? Carefully consider the following example: stocks <- tibble( year = c(2015, 2015, 2016, 2016), half = c( 1, 2, 1, 2), return = c(1.88, 0.59, 0.92, 0.17) ) stocks %>% pivot_wider(names_from = yea...

16250 sym R (2919 sym/21 pcs)

tidydata24_demo

13.03.2020

suppressPackageStartupMessages(library("tidyverse")) package 㤼㸱tidyverse㤼㸲 was built under R version 3.6.3 1. Using prose, describe how the variables and observations are organized in each of the sample tables. In table table1, each row represents a (country, year) combination. The columns cases and population contain the values for thos...

8946 sym R (1232 sym/12 pcs) 1 img

parsevec23_demo

12.03.2020

suppressPackageStartupMessages(library("tidyverse")) package 㤼㸱tidyverse㤼㸲 was built under R version 3.6.3 1. What are the most important arguments to locale()? The locale object has arguments to set the following: date and time formats: date_names, date_format, and time_format time zone: tz numbers: `decimal_mark, grouping_mark encodin...

11910 sym R (2421 sym/34 pcs)

readr21_demo

12.03.2020

library("tidyverse") 1. What function would you use to read a file where fields were separated with “|”? Use the read_delim() function with the argument delim="|". read_delim(file, delim = "|") 2. Apart from file, skip, and comment, what other arguments do read_csv() and read_tsv() have in common? They have the following arguments in common...

6941 sym R (1189 sym/17 pcs)

tibbles21_demo

12.03.2020

suppressPackageStartupMessages(library("tidyverse")) package 㤼㸱tidyverse㤼㸲 was built under R version 3.6.3 1. How can you tell if an object is a tibble? (Hint: try printing mtcars, which is a regular data frame). When we print mtcars, it prints all the columns. mtcars But when we first convert mtcars to a tibble using as_tibble(), it pr...

8874 sym R (1436 sym/40 pcs) 1 img

twocontvars20_demo

12.03.2020

suppressPackageStartupMessages(library("tidyverse")) package 㤼㸱tidyverse㤼㸲 was built under R version 3.6.3 suppressPackageStartupMessages(library("viridis")) package 㤼㸱viridis㤼㸲 was built under R version 3.6.2 1. Instead of summarizing the conditional distribution with a box plot, you could use a frequency polygon. What do you ne...

9781 sym R (1233 sym/12 pcs) 8 img

twocats19_demo

12.03.2020

suppressPackageStartupMessages(library("tidyverse")) package 㤼㸱tidyverse㤼㸲 was built under R version 3.6.3 suppressPackageStartupMessages(library("nycflights13")) package 㤼㸱nycflights13㤼㸲 was built under R version 3.6.3 #These additional package provide functions that will be used in answering some questions. suppressPackageStart...

7308 sym R (1648 sym/11 pcs) 5 img

edacovar18_demo

12.03.2020

suppressPackageStartupMessages(library("tidyverse")) package 㤼㸱tidyverse㤼㸲 was built under R version 3.6.3 suppressPackageStartupMessages(library("nycflights13")) package 㤼㸱nycflights13㤼㸲 was built under R version 3.6.3 #These additional package provide functions that will be used in answering some questions suppressPackageStartu...

17583 sym R (2910 sym/28 pcs) 18 img

eda16_demo

12.03.2020

suppressPackageStartupMessages(library("tidyverse")) package 㤼㸱tidyverse㤼㸲 was built under R version 3.6.3 1. Explore the distribution of each of the x, y, and z variables in diamonds. What do you learn? Think about a diamond and how you might decide which dimension is the length, width, and depth. First, I’ll calculate summary statist...

15942 sym R (2903 sym/28 pcs) 16 img