My Coding Goals This Week

  1. Reproduce descriptive statistics for Experiment 2
  2. Push my code for both Experiment 1 and 2 on GitHub for my group to create a cohesive code to present in Week 8!

How I Made Progress

Setting Up

First, we load our libraries:

  • tidyverse loaded for dplyr, ggplot2
  • ggeasy allows for easy formatting of plots e.g. remove legends
  • ggbeeswarm allows for Categorical Scatter (Violin Point) Plots using gerom_beeswarm
  • patchwork allows for combining all plots into one image
library(tidyverse) 
library(ggeasy)
library(ggbeeswarm)
library(patchwork)

Next, loading the data file for Experiment 2:

  • Creating it as an object in our environment named ‘exptwo’.
  • Read the CSV
  • Rename SC0 to recall_score; FL_10_D0 to condition using the rename()
exptwo <- "Study 7 data.csv" %>% 
  read_csv() %>% 
  rename(
    recall_score = SC0, #nicer name for recall score
    condition = FL_12_DO #nicer name for condition
  )

Tidying up the Data

  1. First, I’ll remove the first 2 rows of the data file as it does not contain participants’ data. I will use slice() for this purpose
  2. As the data file contains a lot of unneeded data (it has 360 columns!) for the purpose of verifying the descriptive statistics, I am going to tidy up the data by reducing the number of variables displayed. This will allow us to more easily work with it.
  3. Using the glimpse() we now see that columns have reduced to 38
exptwo <- exptwo %>% 
  slice(-1:-2) %>% 
  select(Consent, Finished, Gender, Age, NC_1:condition)

glimpse(exptwo)
## Rows: 412
## Columns: 39
## $ Consent                <chr> "1", "1", "1", "1", "1", "1", "1", "1", "1", "1…
## $ Finished               <chr> "1", "1", "1", "1", "1", "1", "1", "1", "1", "1…
## $ Gender                 <chr> "2", "1", "2", "2", "1", "1", "2", "2", "2", "2…
## $ Age                    <chr> "51", "19", "31", "32", "49", "20", "20", "29",…
## $ NC_1                   <chr> "2", "2", "2", "5", "4", "4", "4", "1", "4", "4…
## $ NC_2                   <chr> "2", "2", "1", "4", "4", "4", "4", "1", "4", "4…
## $ NC_3                   <chr> "2", "2", "1", "3", "4", "3", "2", "4", "2", "2…
## $ NC_4                   <chr> "2", "4", "2", "4", "4", "4", "5", "1", "4", "4…
## $ NC_5                   <chr> "2", "3", "2", "2", "4", "2", "4", "4", "2", "2…
## $ NC_6                   <chr> "1", "3", "2", "2", "4", "2", "2", "4", "2", "2…
## $ NBS_1                  <chr> "2", "5", "1", "4", "4", "4", "5", "3", "4", "5…
## $ NBS_2                  <chr> "2", "3", "2", "4", "2", "4", "4", "4", "2", "2…
## $ NBS_3                  <chr> "2", "2", "2", "4", "2", "5", "4", "4", "2", "2…
## $ NBS_4                  <chr> "1", "2", "2", "3", "2", "1", "1", "2", "2", "1…
## $ NBS_5                  <chr> "1", "2", "2", "3", "2", "1", "2", "2", "2", "2…
## $ NBS_6                  <chr> "1", "4", "2", "4", "2", "2", "5", "2", "4", "4…
## $ Mistrust_expertise_1   <chr> "2", "2", "1", "3", "2", "2", "3", "1", "3", "2…
## $ Mistrust_expertise_2   <chr> "2", "1", "1", "2", "1", "1", "2", "1", "3", "3…
## $ Mistrust_expertise_3   <chr> "2", "2", "5", "3", "2", "1", "4", "2", "2", "2…
## $ GSS                    <chr> "1", "1", "1", "2", "1", "1", "2", "1", "2", "2…
## $ Certainty_sci_know_1   <chr> "4", "5", "5", "3", "4", "4", "5", "2", "4", "5…
## $ Certainty_sci_know_2   <chr> "2", "3", "4", "2", "2", "3", "5", "1", "4", "2…
## $ Certainty_sci_know_3   <chr> "4", "5", "5", "4", "5", "5", "5", "5", "3", "4…
## $ Certainty_sci_know_4   <chr> "4", "5", "3", "3", "2", "3", "5", "4", "4", "2…
## $ Certainty_sci_know_5   <chr> "4", "5", "5", "5", "5", "4", "5", "3", "4", "4…
## $ Certainty_sci_know_6   <chr> "4", "5", "5", "5", "4", "4", "4", "5", "3", "2…
## $ Development_sci_know_1 <chr> "4", "5", "5", "5", "4", "5", "5", "5", "4", "5…
## $ Development_sci_know_2 <chr> "4", "4", "5", "4", "5", "5", "5", "5", "4", "5…
## $ Development_sci_know_3 <chr> "4", "5", "5", "4", "4", "5", "4", "5", "5", "5…
## $ Development_sci_know_4 <chr> "4", "4", "5", "4", "5", "5", "5", "5", "5", "5…
## $ Development_sci_know_5 <chr> "5", "5", "5", "4", "5", "5", "5", "5", "5", "5…
## $ Development_sci_know_6 <chr> "5", "4", "5", "4", "4", "5", "4", "5", "4", "4…
## $ Memory_task            <chr> "1", "1", "1", "1", "1", "1", "1", "1", "1", "1…
## $ Memory_task_DO         <chr> "0|1|0|1|1|0|0|1|1|0|0|1|0|1", "0|0|1|1|1|0|1|1…
## $ Serious_check          <chr> "1", "1", "1", "1", "1", "1", "1", "1", "1", "1…
## $ recall_score           <chr> "7", "7", "7", "7", "7", "7", "7", "7", "7", "7…
## $ Prolific_PID           <chr> "5ecad11f815ac263a27af2ad", "5e6da5dfe02fac3787…
## $ Random_ID              <chr> "8661", "8637", "1981", "1161", "9486", "5462",…
## $ condition              <chr> "Block_3_Qualified_Conflict", "Block_3_Qualifie…
  1. I’m checking for duplicate IDs by specifying Prolific_PID and checking for duplicated - 3 duplicate ID found.
  2. Removing this duplicate ID from the data set.
exptwo$Prolific_PID[duplicated(exptwo$Prolific_PID)]
## [1] "5b8800b14fe6450001f07d71" "5ae8d7b596845f0001c7948d"
## [3] "5e68d2b5576136000ba058a2"
exptwo <- exptwo[!duplicated(exptwo$Prolific_PID), ]
  1. Apply pre-registered exclusion criteria using filter(): exclude participants if
  • they did not complete the task,
  • declared they did not respond seriously,
  • or failed an attention check (i.e. recalled <4 headlines correctly during headline recall task).

I am creating this final data set as an object called ‘exptwofinaldata’

  1. Lastly, using count() we can see how many final participants are included in our data set (n=400)
exptwofinaldata <- exptwo %>% 
  filter(
    Consent == "1", #filter to include those who consented
    Finished == "1", #filter to include those who Finished
    Serious_check == "1", #filter to include those who answered they passed Serious Check
    recall_score >= "4", #filter to include recalls core 4 and above only
    )

exptwofinaldata %>% 
  count (Consent)
## # A tibble: 1 x 2
##   Consent     n
##   <chr>   <int>
## 1 1         400

Count Males/Females

According to the paper:

  • Number of participants in FINAL sample: 400 (150 males, 248 females, 2 neither)
  • Age (Mean: 33.5, SD: 12, Range: 18-73)
  1. Since Gender is a Factor variable, I am changing to Gender variable from Character to Factor.
  2. Then, I am using mutate() to replace the existing Gender variable with “1” as male and “2” as female. I do this by specifying with case_when() replacing 1 with Male and 2 with Female.
  3. Finally, using count() we can display the respective numbers of malees and females. The count corresponds with our paper’s reporting of 150 identifying as male, 248 females and 2 neither of those categories.
exptwofinaldata$Gender <- as.factor(exptwofinaldata$Gender)

exptwofinaldata %>% 
  mutate(
    Gender = case_when(
      Gender == 1 ~ "Male",
      Gender == 2 ~ "Female"
    )
  )
## # A tibble: 400 x 39
##    Consent Finished Gender Age   NC_1  NC_2  NC_3  NC_4  NC_5  NC_6  NBS_1 NBS_2
##    <chr>   <chr>    <chr>  <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
##  1 1       1        Female 51    2     2     2     2     2     1     2     2    
##  2 1       1        Male   19    2     2     2     4     3     3     5     3    
##  3 1       1        Female 31    2     1     1     2     2     2     1     2    
##  4 1       1        Female 32    5     4     3     4     2     2     4     4    
##  5 1       1        Male   49    4     4     4     4     4     4     4     2    
##  6 1       1        Male   20    4     4     3     4     2     2     4     4    
##  7 1       1        Female 20    4     4     2     5     4     2     5     4    
##  8 1       1        Female 29    1     1     4     1     4     4     3     4    
##  9 1       1        Female 29    4     4     2     4     2     2     4     2    
## 10 1       1        Female 18    4     4     2     4     2     2     5     2    
## # … with 390 more rows, and 27 more variables: NBS_3 <chr>, NBS_4 <chr>,
## #   NBS_5 <chr>, NBS_6 <chr>, Mistrust_expertise_1 <chr>,
## #   Mistrust_expertise_2 <chr>, Mistrust_expertise_3 <chr>, GSS <chr>,
## #   Certainty_sci_know_1 <chr>, Certainty_sci_know_2 <chr>,
## #   Certainty_sci_know_3 <chr>, Certainty_sci_know_4 <chr>,
## #   Certainty_sci_know_5 <chr>, Certainty_sci_know_6 <chr>,
## #   Development_sci_know_1 <chr>, Development_sci_know_2 <chr>,
## #   Development_sci_know_3 <chr>, Development_sci_know_4 <chr>,
## #   Development_sci_know_5 <chr>, Development_sci_know_6 <chr>,
## #   Memory_task <chr>, Memory_task_DO <chr>, Serious_check <chr>,
## #   recall_score <chr>, Prolific_PID <chr>, Random_ID <chr>, condition <chr>
exptwofinaldata %>% 
  count(Gender)
## # A tibble: 3 x 2
##   Gender     n
##   <fct>  <int>
## 1 1        150
## 2 2        248
## 3 3          2

Calculate Mean, SD & Range for Total Participants

  1. First, I am changing the Age variable from Chr to Dbl, since it is a numeric variable.
  2. Then, I am using the summarise() to display the mean, SD and range for the Age data. I am specifying the data to display as a data frame so it displays all the decimal points (in a tibble it automatically rounds up).
  3. Hooray! This matches with our paper’s report of Mean = 33.5, SD = 12 and Range = 18-73.
exptwofinaldata$Age <- as.numeric(exptwofinaldata$Age)

exptwofinaldata %>% 
  summarise(
    Mean = mean(Age),
    SD = sd(Age),
    Min = min(Age),
    Max = max(Age)
) %>% 
  as.data.frame()
##     Mean       SD Min Max
## 1 33.465 12.03415  18  73

Reproducing Figure 3

Setting Up the Data

  1. Figure 3 is about plotting each variable (Nutritional Confusion, Nutritional Backlash, Mistrust of Expertise, Confidence in Scientific Community, Certainty of Knowledge, & Development of Knowledge) in Experiment 2.
  2. Similar to Experiment 1, we need to split participants’ conditions into 4 variables as it is currently recorded as one variable Block_Number_Format_Conflict. We do this via separate(), specifying the data and column and into new columns ‘block’, ‘number’, ‘format’ and ’conflict. Of particular interest when plotting will be the latter two.
  3. Since these are factor variables, I am changing ‘Format’ and ‘Conflict’ from Chr to Factor.
exptwofinaldata <- separate(data = exptwofinaldata, col = condition, into = c("block", "number", "format", "conflict"))

exptwofinaldata$format <- as.factor(exptwofinaldata$format)
exptwofinaldata$conflict <- as.factor(exptwofinaldata$conflict)
  1. Since there were multiple questions asked for each variable, we need to calculate the participants’ average scores for each variable. First, we will need to change all the corresponding data to numeric from character.
  2. I am going to do this by using mutate() to create a new variable to represent the average scores of each (confusion, backlash, mistrust, confidence, certainty, development). And then using XXXX to calculate the average using each individual scores totaled divided by number of questions asked.
  3. Lastly, I’m showing the tibble from format to development (using select() format:development). This shows us the data we will need for our plotting next!
# Calculate participants' average scores as a new variable for each of the 6 variables studied
exptwofinaldata$NC_1 <- as.numeric(exptwofinaldata$NC_1)
exptwofinaldata$NC_2 <- as.numeric(exptwofinaldata$NC_2)
exptwofinaldata$NC_3 <- as.numeric(exptwofinaldata$NC_3)
exptwofinaldata$NC_4 <- as.numeric(exptwofinaldata$NC_4)
exptwofinaldata$NC_5 <- as.numeric(exptwofinaldata$NC_5)
exptwofinaldata$NC_6 <- as.numeric(exptwofinaldata$NC_6)
exptwofinaldata$NBS_1 <- as.numeric(exptwofinaldata$NBS_1)
exptwofinaldata$NBS_2 <- as.numeric(exptwofinaldata$NBS_2)
exptwofinaldata$NBS_3 <- as.numeric(exptwofinaldata$NBS_3)
exptwofinaldata$NBS_4 <- as.numeric(exptwofinaldata$NBS_4)
exptwofinaldata$NBS_5 <- as.numeric(exptwofinaldata$NBS_5)
exptwofinaldata$NBS_6 <- as.numeric(exptwofinaldata$NBS_6)
exptwofinaldata$Mistrust_expertise_1 <- as.numeric(exptwofinaldata$Mistrust_expertise_1)
exptwofinaldata$Mistrust_expertise_2 <- as.numeric(exptwofinaldata$Mistrust_expertise_2)
exptwofinaldata$Mistrust_expertise_3 <- as.numeric(exptwofinaldata$Mistrust_expertise_3)
exptwofinaldata$GSS <- as.numeric(exptwofinaldata$GSS)
exptwofinaldata$Certainty_sci_know_1 <- as.numeric(exptwofinaldata$Certainty_sci_know_1)
exptwofinaldata$Certainty_sci_know_2 <- as.numeric(exptwofinaldata$Certainty_sci_know_2)
exptwofinaldata$Certainty_sci_know_3 <- as.numeric(exptwofinaldata$Certainty_sci_know_3)
exptwofinaldata$Certainty_sci_know_4 <- as.numeric(exptwofinaldata$Certainty_sci_know_4)
exptwofinaldata$Certainty_sci_know_5 <- as.numeric(exptwofinaldata$Certainty_sci_know_5)
exptwofinaldata$Certainty_sci_know_6 <- as.numeric(exptwofinaldata$Certainty_sci_know_6)
exptwofinaldata$Development_sci_know_1 <- as.numeric(exptwofinaldata$Development_sci_know_1)
exptwofinaldata$Development_sci_know_2 <- as.numeric(exptwofinaldata$Development_sci_know_2)
exptwofinaldata$Development_sci_know_3 <- as.numeric(exptwofinaldata$Development_sci_know_3)
exptwofinaldata$Development_sci_know_4 <- as.numeric(exptwofinaldata$Development_sci_know_4)
exptwofinaldata$Development_sci_know_5 <- as.numeric(exptwofinaldata$Development_sci_know_5)
exptwofinaldata$Development_sci_know_6 <- as.numeric(exptwofinaldata$Development_sci_know_6)

exptwofinaldata <- exptwofinaldata %>% 
  mutate (
    confusion = ((exptwofinaldata$NC_1 + exptwofinaldata$NC_2 + exptwofinaldata$NC_3 + exptwofinaldata$NC_4 + exptwofinaldata$NC_5 + exptwofinaldata$NC_6)/6),
    backlash = ((exptwofinaldata$NBS_1 + exptwofinaldata$NBS_2 + exptwofinaldata$NBS_3 + exptwofinaldata$NBS_4 + exptwofinaldata$NBS_5 + exptwofinaldata$NBS_6)/6),
    mistrust = ((exptwofinaldata$Mistrust_expertise_1 + exptwofinaldata$Mistrust_expertise_2 + exptwofinaldata$Mistrust_expertise_3)/3),
    confidence = exptwofinaldata$GSS,
    certainty = ((exptwofinaldata$Certainty_sci_know_1 + exptwofinaldata$Certainty_sci_know_2 + exptwofinaldata$Certainty_sci_know_3 + exptwofinaldata$Certainty_sci_know_4 + exptwofinaldata$Certainty_sci_know_5 + exptwofinaldata$Certainty_sci_know_6)/6),
    development = ((exptwofinaldata$Development_sci_know_1 + exptwofinaldata$Development_sci_know_2 + exptwofinaldata$Development_sci_know_3 + exptwofinaldata$Development_sci_know_4 + exptwofinaldata$Development_sci_know_5 + exptwofinaldata$Development_sci_know_6)/6)
    )

exptwofinaldata %>% 
  select(format:development)
## # A tibble: 400 x 8
##    format  conflict confusion backlash mistrust confidence certainty development
##    <fct>   <fct>        <dbl>    <dbl>    <dbl>      <dbl>     <dbl>       <dbl>
##  1 Qualif… Conflict      1.83     1.5      2             1      3.67        4.33
##  2 Qualif… Conflict      2.67     3        1.67          1      4.67        4.5 
##  3 Qualif… Consist…      1.67     1.83     2.33          1      4.5         5   
##  4 Generic Conflict      3.33     3.67     2.67          2      3.67        4.17
##  5 Generic Conflict      4        2.33     1.67          1      3.67        4.5 
##  6 Generic Consist…      3.17     2.83     1.33          1      3.83        5   
##  7 Qualif… Consist…      3.5      3.5      3             2      4.83        4.67
##  8 Generic Consist…      2.5      2.83     1.33          1      3.33        5   
##  9 Generic Consist…      3        2.67     2.67          2      3.67        4.5 
## 10 Generic Conflict      3        2.67     2.33          2      3.17        4.83
## # … with 390 more rows

Plotting the Figure

Nutritional Confusion

  1. I am going to create an object called ‘confusion’ for this plot.
  2. Using ggplot, I am first specifying the data for x axis (conflict), y axis (nutrition confusion), and filling according to conflict. We then make this a violin plot using geom_violin().
  3. Then we use facet_wrap() and define the faceting groups using the vars object. I want the faceting group to be Generic/Qualified, so we set this based on ‘format (of condition participants were in)’.
  4. This produces a rough plot of how we want the plot to look like, and we want to add the swarm plots (using geom_beeswarm() from ggbeeswam package), 95% CI and mean (using stat_summary) onto the violin plots. 5. The final steps include formatting the axes, remove the legends and adding a title. I am using scale_y_continuous to label the Y-axis, and then using functions from ggeasy package to center title, remove legend, and remove x-axis label. Finally scale_fill_manual is used to select the desired colour that matches our original authors’ plots.
confusion <- ggplot(
  data = exptwofinaldata,
  aes(
    x = conflict,
    y = confusion,
    fill = conflict
  ) 
) + 
  geom_violin() +
  facet_wrap(
    vars(format),
    strip.position = "bottom" #moves strip to bottom
  ) +
  stat_summary(
    fun.data = "mean_cl_normal",
    geom = "crossbar", #specifying we want crossbars
    fill = "white",    #changing crossbar fill colour
    alpha = .7 #changes transparency of fill to 70%
  ) +
  geom_beeswarm(
    cex = 0.2 #add a bee swarm plot (one-dimensional scatter plot) to show all data points, cex specified width
    ) +
  ggtitle(
    label = "Nutritional Confusion"
  ) +
  easy_center_title() +
  easy_remove_legend() +
  easy_remove_x_axis(
    what = c("title")
  ) +
  scale_y_continuous(
    name = "Nutritional Confusion"
  ) +
  scale_fill_manual(
    values = c("slategray2", "lightpink1") #change violin plot fill colours
  ) 
  
plot(confusion)  

  1. Now, plotting the remaining plots.
backlash <- ggplot(
  data = exptwofinaldata,
  aes(
    x = conflict,
    y = backlash,
    fill = conflict
  ) 
) + 
  geom_violin() +
  facet_wrap(
    vars(format),
    strip.position = "bottom" #moves strip to bottom
  ) +
  stat_summary(
    fun.data = "mean_cl_normal",
    geom = "crossbar", #specifying we want crossbars
    fill = "white",    #changing crossbar fill colour
    alpha = .7 #changes transparency of fill to 70%
  ) +
  geom_beeswarm(
    cex = 0.2 #add a bee swarm plot (one-dimensional scatter plot) to show all data points, cex specified width
    ) +
  ggtitle(
    label = "Nutritional Backlash"
  ) +
  easy_center_title() +
  easy_remove_legend() +
  easy_remove_x_axis(
    what = c("title")
  ) +
  scale_y_continuous(
    name = "Nutritional Backlash"
  ) +
  scale_fill_manual(
    values = c("slategray2", "lightpink1") #change violin plot fill colours
  ) 
  
plot(backlash)  

mistrust <- ggplot(
  data = exptwofinaldata,
  aes(
    x = conflict,
    y = mistrust,
    fill = conflict
  ) 
) + 
  geom_violin() +
  facet_wrap(
    vars(format),
    strip.position = "bottom" #moves strip to bottom
  ) +
  stat_summary(
    fun.data = "mean_cl_normal",
    geom = "crossbar", #specifying we want crossbars
    fill = "white",    #changing crossbar fill colour
    alpha = .7 #changes transparency of fill to 70%
  ) +
  geom_beeswarm(
    cex = 0.2 #add a bee swarm plot (one-dimensional scatter plot) to show all data points, cex specified width
    ) +
  ggtitle(
    label = "Mistrust of Expertise"
  ) +
  easy_center_title() +
  easy_remove_legend() +
  easy_remove_x_axis(
    what = c("title")
  ) +
  scale_y_continuous(
    name = "Mistrust of Expertise"
  ) +
  scale_fill_manual(
    values = c("slategray2", "lightpink1") #change violin plot fill colours
  ) 
  
plot(mistrust)  

confidence <- ggplot(
  data = exptwofinaldata,
  aes(
    x = conflict,
    y = confidence,
    fill = conflict
  ) 
) + 
  geom_violin() +
  facet_wrap(
    vars(format),
    strip.position = "bottom" #moves strip to bottom
  ) +
  stat_summary(
    fun.data = "mean_cl_normal",
    geom = "crossbar", #specifying we want crossbars
    fill = "white",    #changing crossbar fill colour
    alpha = .7 #changes transparency of fill to 70%
  ) +
  geom_beeswarm(
    cex = 0.2 #add a bee swarm plot (one-dimensional scatter plot) to show all data points, cex specified width
    ) +
  ggtitle(
    label = "Confidence in Scientific Community"
  ) +
  easy_center_title() +
  easy_remove_legend() +
  easy_remove_x_axis(
    what = c("title")
  ) +
  scale_y_continuous(
    name = "Confidence in Scientific Community"
  ) +
  scale_fill_manual(
    values = c("slategray2", "lightpink1") #change violin plot fill colours
  ) 
  
plot(confidence)  

certainty <- ggplot(
  data = exptwofinaldata,
  aes(
    x = conflict,
    y = certainty,
    fill = conflict
  ) 
) + 
  geom_violin() +
  facet_wrap(
    vars(format),
    strip.position = "bottom" #moves strip to bottom
  ) +
  stat_summary(
    fun.data = "mean_cl_normal",
    geom = "crossbar", #specifying we want crossbars
    fill = "white",    #changing crossbar fill colour
    alpha = .7 #changes transparency of fill to 70%
  ) +
  geom_beeswarm(
    cex = 0.2 #add a bee swarm plot (one-dimensional scatter plot) to show all data points, cex specified width
    ) +
  ggtitle(
    label = "Certainty of Knowledge"
  ) +
  easy_center_title() +
  easy_remove_legend() +
  easy_remove_x_axis(
    what = c("title")
  ) +
  scale_y_continuous(
    name = "Certainty of Knowledge"
  ) +
  scale_fill_manual(
    values = c("slategray2", "lightpink1") #change violin plot fill colours
  ) 
  
plot(certainty)  

development <- ggplot(
  data = exptwofinaldata,
  aes(
    x = conflict,
    y = development,
    fill = conflict
  ) 
) + 
  geom_violin() +
  facet_wrap(
    vars(format),
    strip.position = "bottom" #moves strip to bottom
  ) +
  stat_summary(
    fun.data = "mean_cl_normal",
    geom = "crossbar", #specifying we want crossbars
    fill = "white",    #changing crossbar fill colour
    alpha = .7 #changes transparency of fill to 70%
  ) +
  geom_beeswarm(
    cex = 0.2 #add a bee swarm plot (one-dimensional scatter plot) to show all data points, cex specified width
    ) +
  ggtitle(
    label = "Development of Knowledge"
  ) +
  easy_center_title() +
  easy_remove_legend() +
  easy_remove_x_axis(
    what = c("title")
  ) +
  scale_y_continuous(
    name = "Development of Knowledge"
  ) +
  scale_fill_manual(
    values = c("slategray2", "lightpink1") #change violin plot fill colours
  ) 
  
plot(development)  

Finally, all plots together

I am using the patchwork package’s plot_layout function to put all plots together.

combinedplot2 <- confusion + backlash + mistrust + confidence + certainty + development + plot_layout(ncol = 2)

plot (combinedplot2)

Successes

  1. I tried to make the code simpler where possible, and also add commentary on each step I was taking (rubber duck)!
  2. This time things were a lot smoother sailing, I also spent a little more effort tidying up the tibble which made using glimpse() a lot easier and seeing the data was really helpful in determining my next steps to take for reproducing the plots.

Challenges

  1. The plots all seem pretty cramped together, but Sam found us a way to make the output bigger!

Next Steps in My Coding Journey

  1. Creating one cohesive/master code for us to present on Week 8 with! It will be interesting to see how different/similar our codes are