文献计量学系列33: 关键词时间分布规律
内容涵盖文档、作者、期刊、研究机构和国家等相关文献计量学指标分析
更多自定义函数
一次性获取较多文献计量指标
让学习更轻松!
学习力,才是最大的竞争力!扫码约我吧!
一、keywordGrowth函数简介
二、加载包和数据导入
pacman::p_load(bibliometrix, rio, tidyverse, Hmisc)
m1_TE <- import(file = 'E:/精鼎统计/m1_TE.xlsx')
rownames(m1_TE) <- m1_TE$SR
三、关键词描述统计
关键词词频:
kwg <- KeywordGrowth(m1_TE, Tag = 'DE_TM', sep = ';', top = 10, cdf = FALSE)#提取累加词频排名前10的关键词的词频
head(kwg)
# Year CATCHMENT STABLE-ISOTOPE RUNOFF GROUNDWATER PRECIPITATION RUNOFF-GENERATION MODEL TRACER BASIN
# 1 1991 1 0 1 0 0 2 1 1 0
# 2 1992 1 0 2 0 0 0 0 0 0
# 3 1993 3 0 3 4 0 1 1 0 1
# 4 1994 2 0 1 1 1 2 2 0 0
# 5 1995 2 0 3 2 1 2 1 0 1
# 6 1996 3 0 2 3 0 1 1 2 0
# RIVER
# 1 0
# 2 0
# 3 0
# 4 0
# 5 0
# 6 0
#figure
kwggather <- gather(kwg, key = 'keywords', value = 'Freq', -Year)#宽数据框转长数据框
kwggather$Freq[which(kwggather$Freq == 0)] <- NA#频率为0变空值NA
kwggather$Freq_min <- ifelse(kwggather$Freq >= 5, kwggather$Freq, NA)#最小展示频率
kwggather$year1 <- ifelse(is.na(kwggather$Freq), NA, kwggather$Year)#添加线的x轴值
kwggather$keywords <- factor(kwggather$keywords,levels = names(kwg)[-1])#字符格式转因子格式
kwgth <- ggplot(kwggather, aes(x = Year, y = keywords))+
geom_line(aes(x = year1, y = keywords, group = keywords), size = 0.8, color="firebrick", alpha = 0.3)+
geom_point(aes(size = Freq),color = "dodgerblue4", alpha = 0.5)+
geom_text(aes(label = Freq_min), size = 3)+
scale_y_discrete(limits = rev(levels(kwggather$keywords)),
labels = rev(unique(capitalize(tolower((kwggather$keywords))))))+
scale_x_continuous(limits = c(1991,2019),breaks = seq(1991,2019,1))+
labs(x = '', y = '', size = 'Frequency')+
theme_bw()+
theme(panel.grid = element_blank(),
axis.text = element_text(size = 12),
axis.text.x = element_text(angle = 90, vjust = 0.4),
legend.text = element_text(size = 14),
legend.title = element_text(size = 20))+
scale_size_continuous(breaks = seq(5,35,5))
kwgth
关键词累加词频:
kwg1 <- KeywordGrowth(m1_TE, Tag = 'DE_TM', sep = ';', top = 10, cdf = TRUE)
kwggather1 <- gather(kwg1, key = 'keywords', value = 'cumFreq', -Year)
kwggather1$keywords <- capitalize(tolower(kwggather1$keywords))
kwggather1$keywords <- factor(kwggather1$keywords,levels = capitalize(tolower(names(kwg1)))[-1])
kwgth1 <- ggplot(kwggather1, aes(x = Year, y = cumFreq, color = keywords))+
geom_line()+
scale_x_continuous(limits = c(1991,2019),breaks = seq(1991,2019,1))+
labs(x = '', y = 'Accumulative Frequency')+
theme(axis.title = element_text(size = 14),
axis.text = element_text(size = 12),
axis.text.x = element_text(angle = 90, vjust = 0.4),
legend.text = element_text(size = 14),
legend.title = element_text(size = 20))
kwgth1
四、小结
keywordGrowth函数除了对关键词的进行分析外,还可以对其他的字段标识进行分析,比如作者(AU),国家(AU_CO)等,感兴趣的同学自己可以试一试。
赞 (0)