For my last week of coding this term, my goals were to finish revising my exploratory analysis questions, and making sure that I am showcasing all of the R skills that I have learned this term as I complete my final verification report.
During our final workshop on Friday, I certainly was not expecting us to be making memes! Nonetheless, it was a very pleasant surprise!! It was a really enjoyable activity, though Thomas and I found it very challenging! We literally googled “How to make memes in R” and conveniently, the first result that came up was Jenny’s meme blog!
At first, we went with the third option, which was to use the “memery” package because neither of us knew how to install packages from GitHub. However, we kept getting the same error and we spent most of the time we were given to figure out what it meant.
Since we were running out of time, we decided to go with option 2 and use the “meme” package and it worked perfectly fine!
The remaining issue what that the font looked a bit strange, but as Jenny said, it still conveyed the same message :D
library(tidyverse)## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.3 v purrr 0.3.4
## v tibble 3.1.0 v dplyr 1.0.5
## v tidyr 1.1.3 v stringr 1.4.0
## v readr 1.4.0 v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(memery)## Loading required package: showtext
## Loading required package: sysfonts
## Loading required package: showtextdb
Honestly I had such a fun time making memes, that I did some procrasti-coding and made another meme!
library(memer)
meme_get("NoneOfMyBusiness") %>%
meme_text_top("When you submit your verification \n report before 11:59pm on Monday night", size=30)I also FINALLY did my third exploratory analysis! I decided on whether the importance that the participants placed on being equipped with hand sanitiser to deal with COVID-19 was related to them engaging in physical distancing.
However, the amount of problems that I ran into whilst doing this analysis was astronomical. Thankfully Victoria’s learning log had most of the solutions to my problems!
library(tidyverse)
library(dbplyr)
library(ggplot2)
library(haven)
library(here)
library(janitor)
library(gt)
library(ggeasy)
library(gridExtra)
library(plyr)
library(dplyr)
library(anomalize)
library(RColorBrewer)
library(car)
library(lubridate)#import data from studies 1 and 2
Study1USA <- read_sav("PSYC3361 Project/COVID paper data+syntax/Study1USA.sav")
Study1UK <- read_sav("PSYC3361 Project/COVID paper data+syntax/Study1UK.sav")
Study1Germany <- read_sav("PSYC3361 Project/Study1Germany.sav")
# Variable name for measuring importance of hand sanitiser: Q22_7
# Variable name for measuring physical distancing: sd
Study1USA$Q22_7 <- as.numeric(Study1USA$Q22_7)
Study1UK$Q22_7 <- as.numeric(Study1UK$Q22_7)
Study1Germany$Q22_7 <- as.numeric(Study1Germany$Q22_7)
# Mutate Study1Germany's Q22_7 values to be consistent with value from other countries
Study1Germany <- Study1Germany %>%
mutate(Q22_7 = case_when(
Q22_7 == 28 ~ "1",
Q22_7 == 29 ~ "2",
Q22_7 == 30 ~ "3",
Q22_7 == 31 ~ "5",
Q22_7 == 32 ~ "4"
))
# Combining hand sanitiser data from each sample
Study1USA <- Study1USA %>%
select(Q22_7, sd) %>%
mutate(country = "USA")
Study1UK <- Study1UK %>%
select(Q22_7, sd) %>%
mutate(country = "UK")
Study1Germany <- Study1Germany %>%
select(Q22_7, sd) %>%
mutate(country = "Germany")
exploreQ3 <- do.call("rbind", list(Study1USA, Study1UK, Study1Germany))
exploreQ3_avg <- exploreQ3 %>%
group_by(Q22_7, country) %>%
summarise(sd = mean(sd))The only thing is, my plot does not look quite right, so if the is any way I can fix this, that would be amazing! Otherwise, I will keep working at it before I submit my report.
# Plotting importance of hand sanitiser against physical distancing for each country
exploreQ3_avg <- NA
exploreQ3_avg <- as.factor(exploreQ3_avg)
ggplot(
data = exploreQ3,
aes(
x = Q22_7,
y = sd,
fill = country)
) +
geom_col(
position = "dodge"
) +
# colour scheme
scale_fill_brewer() +
scale_y_continuous(
limits = c(0,5),
"Physical Distancing"
) +
scale_x_discrete("Importance of Hand Sanitiser") +
labs(
fill = "Country"
)exploreQ3_anova <- aov(sd ~ Q22_7 + country, data = exploreQ3)
Anova(exploreQ3_anova, type = "II")## Anova Table (Type II tests)
##
## Response: sd
## Sum Sq Df F value Pr(>F)
## Q22_7 23.54 4 5.5457 0.0002048 ***
## country 3.41 2 1.6086 0.2006983
## Residuals 1016.52 958
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Seems to be indicating that that social distancing is significant across hand sanitiser usage, but not across countries.I am really sad that this course is ending, but I could not be any more grateful for the experience I have had throughout this term - thank you so much Jenny. R, Jenny.S, Kate, Dani and Group 2 for everything!!
I feel like I have gained many new skills and I was really lucky to work with an amazing group. The remaining things I have to do are mainly just fixing my code and making sure that it knits okay in a word document.