Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- attach(trustData)
- ag<-aggregate(trustData, by = list(type = face_category_and_gender2_ZAUFANIE), mean)
- plot <- ggplot(data=ag, aes(x=type, y=response)) + list(geom_point(colour= 'red'))
- plot
- library(dplyr)
- library(tidyr)
- library(ggplot2)
- ag %>%
- separate(type, into = c("val", "Type"), "(?=[A-Z])", remove = FALSE) %>%
- mutate(Type = factor(Type, levels =c("M", "K"), labels = c("Men", "Woman"))) %>%
- ggplot(., aes(x = val, y = response, col = Type)) +
- geom_point()
- ag %>%
- separate(type, into = c("val", "Type"), "(?=[A-Z])", remove = FALSE) %>%
- mutate(Sex = case_when(.$Type == "M" ~ "Men", TRUE ~ "Woman")) %>%
- ggplot(., aes(x = val, y = response, col = Type)) +
- geom_point()
- ag <- structure(list(type = c("12K", "12M", "15K", "15M", "1K", "1M",
- "4K", "4M", "7K", "7M", "9K", "9M"), response = c(41.83, 42.45,
- 40.61, 40.69, 64.59, 57.88, 61.2, 54.71, 49.23, 48.24, 44.27,
- 45.09)), .Names = c("type", "response"), row.names = c(NA, -12L
- ), class = "data.frame")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement