segsimcat <- read_delim("~/segsimcat.txt",
"\t", escape_double = FALSE, trim_ws = TRUE)
View(segsimcat)
colnames(segsimcat)
library(ggplot2)
library(dplyr)
unique(segsimcat$name)
ggplot(filter(segsimcat,name=="美食"), aes(sim)) +
geom_histogram(bins = 100)
ggplot(segsimcat, aes(sim, colour = name)) +
geom_freqpoly(bins = 100)+theme(text = element_text(family = "STHeiti"))
# binwidth = 500
ggplot(segsimcat, aes(sim, fill = name)) +
geom_histogram(bins = 100)+theme(text = element_text(family = "STHeiti"))
for(x in unique(segsimcat$name)){
print(ggplot(filter(segsimcat,name==x), aes(sim)) +
geom_histogram(bins = 100)+ggtitle(x)+theme(text = element_text(family = "STHeiti"))
)}
ggplot2在for循环中的问题 https://stackoverflow.com/questions/15678261/r-ggplot-does-not-work-if-it-is-inside-a-for-loop-although-it-works-outside-of
中文显示问题 http://not.farbox.com/post/chinese-character-font-mac-rlan
rmarkdown 到pdf的中文问题:
https://github.com/yixuan/showtext
https://statr.me/2014/01/using-system-fonts-in-r-graphs/
rmarkdown 到pdf的中文问题:
https://github.com/yixuan/showtext
https://statr.me/2014/01/using-system-fonts-in-r-graphs/
No comments:
Post a Comment