R기초; R 기초 - ggplot2 그래픽5 - 테마
R기초; R 기초 - ggplot2 그래픽5 - 테마 library(ggplot2) library(car) str(Salaries) ggplot(Salaries, aes(x=yrs.since.phd, y=salary, color=rank, shape=rank)) + geom_point() + facet_grid(. ~ sex) + theme_gray() ?theme_gray theme() ggplot(Salaries, aes(x=rank, y=salary, fill=sex)) + geom_boxplot() + labs(title="Salary by Rank and Sex", x="Rank", y="Salary") + theme(plot.title=element_text(face="bold.italic",..
2021. 1. 24.
R 기초 - ggplot2 그래픽4 - 그래프 옵션
R 기초 - ggplot2 그래픽4 - 그래프 옵션 library(ggplot2) library(car) str(Salaries) ggplot(Salaries, aes(x=rank, y=salary, fill=sex)) + geom_boxplot() + scale_x_discrete(breaks=c("AsstProf", "AssocProf", "Prof"), labels=c("Assistant Professor", "Associate Professor", "Professor")) + scale_y_continuous(breaks=c(50000, 100000, 150000, 200000), labels=c("$50k", "$100k", "$150k", "$200k") scale_x_discrete() sc..
2021. 1. 24.