# mc24_prototypes_long <- mc24_patterns |> # filter(Pattern.Type=="prototype") |># gather(key = "coordinate", value = "value", -id, -condit, -exp, -file, -Category) %>%# separate(coordinate, into = c("axis", "number"), sep = 1) %>%# spread(key = axis, value = value) %>%# mutate(number = as.integer(number))# mc24_prototypes_long |># filter(id %in% c("1.low","10.medium","112.high")) |># ggplot(aes(x = x, y = y)) +# geom_point() + # Add dots# facet_grid(id ~ Category) + # Create a grid of plots, with subjects by rows and categories by columns# pat_themes
Display code
pat_long<-mc24_patterns|>filter(Phase==2)|>select(id, condit, Category, Pattern.Type, x1:y9)|>group_by(id, condit, Category, Pattern.Type)|>slice_head(n=1)|>gather(key ="coordinate", value ="value", -id, -condit, -Category,-Pattern.Type)%>%separate(coordinate, into =c("axis", "number"), sep =1)%>%spread(key =axis, value =value)%>%mutate(number =as.integer(number))pat_long|>filter(Category==1, id%in%c("1.low","10.medium","112.high"),Pattern.Type!="old")|>ggplot(aes(x =x, y =y,col=Pattern.Type))+geom_point()+# Add dotsggh4x::facet_grid2(id~Pattern.Type, margins=c("Pattern.Type"))+# Create a grid of plots, with subjects by rows and categories by columnspat_themes+labs(title="Prototypes from Category 1 - with distortions")
Display code
pat_long|>mutate(Category =as.factor(Category))|>filter(id%in%c("1.low","10.medium"),Pattern.Type!="old")|>ggplot(aes(x =x, y =y,col=Category))+geom_point()+# Add dots#ggh4x::facet_nested_wrap(id~Category~Pattern.Type) + #ggh4x::facet_grid2(id ~ Category ~ Pattern.Type) +ggh4x::facet_nested(~id+Category~Pattern.Type)+pat_themes+labs(title="all 3 Category Prototypes and their distortions")
Display code
pat_long|>filter(id%in%c("1.low","10.medium","112.high"),Pattern.Type!="old")|>ggplot(aes(x =x, y =y))+geom_point(aes(color =Pattern.Type, alpha =Pattern.Type))+scale_color_manual(values =c("prototype"="black", # Black for prototype"old"="#E69F00", # Orange for old"new_low"="#56B4E9", # Blue for new_low"new_med"="#009E73", # Green for new_med"new_high"="red"))+# Yellow for new_high scale_alpha_manual(values = c("prototype" = 1, "old" = 0.5, "new_low" = 0.5, "new_med" = 0.5, "new_high" = 0.5)) +scale_alpha_manual(values =c("prototype"=1, "old"=0.2, "new_low"=0.6, "new_med"=0.4, "new_high"=0.4))+facet_grid(id~Category)+pat_themes+labs(title="Prototypes with 1 disortion overlaid")
Display code
pat_long<-mc24_patterns|>filter(Phase==2)|>select(id, condit,trial, item_label,Category, Pattern.Type, x1:y9)|>group_by(id, condit, Category, Pattern.Type)|>slice_head(n=10)|>gather(key ="coordinate", value ="value", -id, -condit,-trial,-item_label, -Category,-Pattern.Type)%>%separate(coordinate, into =c("axis", "number"), sep =1)%>%spread(key =axis, value =value)%>%mutate(number =as.integer(number))pat_long|>filter(id%in%c("1.low","10.medium","112.high"),Pattern.Type!="old")|>ggplot(aes(x =x, y =y))+geom_point(aes(color =Pattern.Type, alpha =Pattern.Type, size=Pattern.Type))+scale_color_manual(values =c("prototype"="black", # Black for prototype"old"="#E69F00", # Orange for old"new_low"="#56B4E9", # Blue for new_low"new_med"="#009E73", # Green for new_med"new_high"="red"))+# Yellow for new_high scale_alpha_manual(values = c("prototype" = 1, "old" = 0.5, "new_low" = 0.5, "new_med" = 0.5, "new_high" = 0.5)) +scale_alpha_manual(values =c("prototype"=4, "new_low"=0.5, "new_med"=0.4, "new_high"=0.2))+scale_size_manual(values =c("prototype"=1.5, "new_low"=1, "new_med"=1, "new_high"=1))+facet_grid(id~Category)+pat_themes+labs(title="Prototypes with 10 disortion overlaid")
Display code
pat_long|>mutate(Category=as.factor(Category))|>filter(id%in%c("1.low","10.medium","112.high"),Pattern.Type!="old")|>ggplot(aes(x =x, y =y))+geom_point(aes(color =Category),alpha=.9)+facet_grid(id~Pattern.Type)+pat_themes
Display code
pat_long_train<-mc24_patterns|>mutate(Category=as.factor(Category))|>filter(id%in%ids[1:16])|>filter(Phase==1)|>select(id, condit,trial, Category, Pattern.Type, x1:y9)|>group_by(id, condit, Category, Pattern.Type)|>gather(key ="coordinate", value ="value", -id, -condit,-trial, -Category,-Pattern.Type)%>%separate(coordinate, into =c("axis", "number"), sep =1)%>%spread(key =axis, value =value)%>%mutate(number =as.integer(number))pat_long_train|>ggplot(aes(x =x, y =y))+geom_point(aes(color =Category),alpha=.7)+facet_wrap(~condit+id,ncol=4)+pat_themes
Display code
pat_long_train<-mc24_patterns|>mutate(Category=as.factor(Category))|>filter(id%in%ids[1:3])|>filter(Phase==1|Pattern.Type=="prototype")|>select(id, condit,trial, Category, Pattern.Type,Phase, x1:y9)|>group_by(id, condit, Category, Pattern.Type,Phase)|>gather(key ="coordinate", value ="value", -id, -condit,-trial, -Category,-Pattern.Type,-Phase)%>%separate(coordinate, into =c("axis", "number"), sep =1)%>%spread(key =axis, value =value)%>%mutate(number =as.integer(number), itemType=case_match(Phase,1~"Trained",2~"Prototype"))pat_long_train|>ggplot(aes(x =x, y =y))+geom_point(aes(color =Category),alpha=.8)+ggh4x::facet_nested_wrap(~condit+id+itemType,ncol=2)+pat_themes
Display code
pat_long|>ungroup()|>filter(id%in%ids[1:5]&Pattern.Type=="prototype")|>droplevels()|>mutate(Category=as.factor(Category))|>ggplot(aes(x =x, y =y))+geom_point(aes(color=id),alpha=.9)+facet_grid(id~Category)+pat_themes+labs(title="Prototypes from first 5 subjects - should match first 10 task trials")
Display code
pat_long|>ungroup()|>filter(id%in%ids[1:5]&Pattern.Type=="prototype")|>droplevels()|>mutate(Category=as.factor(Category))|>ggplot(aes(x =x, y =y))+geom_point(aes(color=id),alpha=.9)+ggh4x::facet_wrap2(~id+item_label)+pat_themes+labs(title="Prototypes from first 5 subjects - should match first 10 task trials")
Display code
pat_long|>ungroup()|>filter(id=="57.low"&Pattern.Type=="prototype")|>droplevels()|>mutate(Category=as.factor(Category))|>ggplot(aes(x =x, y =y))+geom_point(aes(color=id),alpha=.9)+ggh4x::facet_wrap2(~id+item_label)+pat_themes+labs(title="Prototypes from first 5 subjects - should match first 10 task trials")
Display code
pat_long|>ungroup()|>filter(id=="57.low"&Pattern.Type=="prototype")|>droplevels()|>mutate(Category=as.factor(Category), y =-y)|>ggplot(aes(x =x, y =y))+geom_point(aes(color=id),alpha=.9)+ggh4x::facet_wrap2(~id+item_label)+pat_themes+labs(title="Prototypes from first 5 subjects - should match first 10 task trials")