I want you to use the same plot as shown above in pic, while satisfying the conditions above. Also, I want to know how to change the following labels as numbered in the pic below.
If someone can explain their answer, I would be super appreciative!
I tried this code but there are few things can not change yet e.g., The Opening_text (2), the legend (5), and the gray background as well as the "lm" is still colored not gray
I have a similar question that had not been answered here
I have made so much progress but there is only two things that I still need help with. For the purpose to keep my replay here focused on the same topic, one of my questions is about how to change the the content of facet_grid(~type+morphotype) ?
Here is a regex and my question is how to change the content of facet_wrap(~Opening_text) to "Now Attend to Visual" , "Now Attend to Auditory"
I suspect this should not have been asked here, but I will answer and perhaps someone will move the two posts.
If I understand you correctly, I would simply make a new column mapping the old Opening_text values to the desired new ones.
Notice that I changed the url.
If this does not anser your question, please do make a new thread.
library(dplyr)
library(readr)
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 3.5.3
#url <- "https://github.com/MohJumper/VisualAuditoryModality/blob/master/clean_test_master2.csv"
url <- "https://raw.githubusercontent.com/MohJumper/VisualAuditoryModality/master/clean_test_master2.csv"
clean_test_master2 <- read.csv(url)
# code used
clean_test_master2 %>%
mutate(visbility_sound = case_when(
visbility == 1 & soundvolume == 0 ~ "Visual",
visbility == 0 & soundvolume == 1 ~ "Auditory",
visbility == 0 & soundvolume == 0 ~ "Empty")) %>%
mutate_at(vars(visbility_sound), factor) %>%
mutate(Opening_text_new = ifelse(Opening_text == "Now focus on the Image", "Now Attend to Visual",
"Now Attend to Auditory")) %>%
ggplot(aes(x = stim_ending_t, y = m, color = visbility_sound)) +
geom_line(aes(linetype = visbility_sound)) +
geom_point(aes(color = visbility_sound, shape = visbility_sound))+
xlab("Sample Durations in Seconds") + ylab("Mean responses") +
theme_bw() +
theme(legend.background = element_rect(fill = "darkgray"),
legend.key = element_rect(fill = "white", color = NA),
legend.key.size = unit(1.9, "cm"),
axis.title.y=element_text(size=15),
axis.text.x=element_text(size=15),
legend.key.width = unit(0.01,"cm")) +
facet_wrap(~Opening_text_new)
Created on 2019-10-27 by the reprex package (v0.3.0.9000)