Skip to content

Commit 65417be

Browse files
committed
bibliometrix v2.1.0
============== New functionality: * biblioshiny networks are now plotted using VisNetwork package. * biblioshiny menu have been completely rewritten. Now, descriptive analyses are organized by the unit of analysis * Several descriptive plots and tables have been added * Added the new funtion authorProdOverTime to calclulate and plot the productivity over the time of the top authors * Added "measure" parameter in plotThematicEvolution * Added the new function bib2df. It give the possibility to import data from a "generic" bibtex file format (i.e. Zotero, JabRef, etc.) * Added the possibility to calculate H-index for sources
1 parent b2cc57f commit 65417be

File tree

11 files changed

+1707
-746
lines changed

11 files changed

+1707
-746
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: bibliometrix
22
Type: Package
33
Title: An R-Tool for Comprehensive Science Mapping Analysis
4-
Version: 2.0.3
5-
Date: 2018-11-19
4+
Version: 2.1.0
5+
Date: 2019-01-06
66
Authors@R: c(person("Massimo", "Aria", email = "[email protected]", role=c("cre","aut")),
77
person("Corrado", "Cuccurullo", email = "[email protected]", role="aut"))
88
Description: Tool for quantitative research in scientometrics and bibliometrics.

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ S3method(summary,bibliometrix)
55
S3method(summary,bibliometrix_netstat)
66
export(Hindex)
77
export(KeywordGrowth)
8+
export(authorProdOverTime)
89
export(bib2df)
910
export(biblioAnalysis)
1011
export(biblioNetwork)

NEWS

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
bibliometrix v2.0.3 (Release date: 2018-11-19)
1+
bibliometrix v2.1.0 (Release date: 2019-01-06)
22
==============
33

44
New functionality:
5+
* biblioshiny networks are now plotted using VisNetwork package.
6+
* biblioshiny menu have been completely rewritten. Now, descriptive analyses are organized by the unit of analysis
7+
* Several descriptive plots and tables have been added
8+
* Added the new funtion authorProdOverTime to calclulate and plot the productivity over the time of the top authors
59
* Added "measure" parameter in plotThematicEvolution
610
* Added the new function bib2df. It give the possibility to import data from a "generic" bibtex file format (i.e. Zotero, JabRef, etc.)
711
* Added the possibility to calculate H-index for sources
@@ -10,6 +14,7 @@ New functionality:
1014
Changes:
1115
* Completely rewritten the importing function from bibtex files
1216
* Solved an issue in dominance(). Now Dominance factor in correctly calculated
17+
* Solved sevaral issues in importing functions due to inconsistence in WOS/SCOPUS web-exporting procedures
1318

1419

1520

R/Hindex.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Hindex <- function(M, field="author", elements, sep = ";",years=10){
7070
## identify manuscripts of the author or of the sources
7171

7272

73-
H=data.frame(Element=elements,h_index=0,g_index=0,m_index=0,TC=0,NP=0)
73+
H=data.frame(Element=elements,h_index=0,g_index=0,m_index=0,TC=0,NP=0, stringsAsFactors = FALSE)
7474
TotalCitations=list()
7575
for (j in 1:length(elements)){
7676
author=elements[j]
@@ -92,7 +92,7 @@ Hindex <- function(M, field="author", elements, sep = ";",years=10){
9292
}
9393
#TotalCitations[[j]]=data.frame(Year=as.numeric(M$PY[ind]),TC,Year2=sort(as.numeric(M$PY[ind])),TC2)
9494
if (length(ind)>0){
95-
df=data.frame(Authors=substr(M$AU[ind], 1, 30),Journal=substr(M$SO[ind], 1, 30),Year=as.numeric(M$PY[ind]),TotalCitation=M$TC[ind])
95+
df=data.frame(Authors=substr(M$AU[ind], 1, 30),Journal=substr(M$SO[ind], 1, 30),Year=as.numeric(M$PY[ind]),TotalCitation=M$TC[ind], stringsAsFactors = FALSE)
9696
TotalCitations[[j]]=df[order(df$TotalCitation),]
9797
}
9898
}

R/authorProdOverTime.R

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#' Top-Authors' Productivity over the Time
2+
#'
3+
#' It calculates and plots the author production (in terms of number of publications) over the time.
4+
#' @param M is a bibliographic data frame obtained by \code{\link{convert2df}} function.
5+
#' @param k is a integer. It is the number of top auhtors to analize and plot. Default is \code{k = 10}.
6+
#' @param graph is logical. If TRUE the function plots the author production over time graph. Default is \code{graph = TRE}.
7+
#' @return The function \code{authorProdOverTime} returns a list containing two objects:
8+
#' \tabular{lll}{
9+
#' \code{dfAU} \tab \tab is a data frame\cr
10+
#' \code{graph} \tab \tab a ggplot object}
11+
#'
12+
#' @examples
13+
#' data(scientometrics)
14+
#' res <- authorProdOverTime(scientometrics, k=10)
15+
#' print(res$dfAU)
16+
#' plot(res$graph)
17+
#'
18+
#' @seealso \code{\link{biblioAnalysis}} function for bibliometric analysis
19+
#' @seealso \code{\link{summary}} method for class '\code{bibliometrix}'
20+
#'
21+
#' @export
22+
#'
23+
authorProdOverTime <- function(M,k=10, graph=TRUE){
24+
25+
M$TC=as.numeric(M$TC)
26+
M$PY=as.numeric(M$PY)
27+
AU=names(tableTag(M,"AU"))
28+
k=min(k,length(AU))
29+
AU=AU[1:k]
30+
#AU=names(AU)
31+
df=data.frame("Author"="NA","year"=NA, "TC"=NA,"TCpY"=NA,stringsAsFactors = FALSE)
32+
Y=as.numeric(substr(Sys.time(),1,4))
33+
for (i in 1:length(AU)){
34+
35+
ind=which(regexpr(AU[i],M$AU)>-1)
36+
TCpY=M$TC[ind]/(Y-M$PY[ind]+1)
37+
dfAU=data.frame("Author"=rep(AU[i],length(ind)),"year"=M$PY[ind],"TC"=M$TC[ind], "TCpY"=TCpY,stringsAsFactors = TRUE)
38+
df=rbind(df,dfAU)
39+
}
40+
df=df[-1,]
41+
42+
df2<-dplyr::group_by(df, Author,year) %>%
43+
dplyr::summarise(freq=length(year),TC=sum(TC),TCpY=sum(TCpY))
44+
45+
df2=as.data.frame(df2)
46+
df2$Author=factor(df2$Author,levels=AU[1:k])
47+
#theme_set(theme_bw())
48+
49+
g <- ggplot(df2, aes(Author, year))+
50+
geom_point(aes(alpha=df2$TCpY,size = df2$freq), color="dodgerblue4")+
51+
scale_size(range=c(2,6))+
52+
scale_alpha(range=c(0.3,1))+
53+
scale_y_continuous(breaks = seq(min(df2$year),max(df2$year), by=2))+
54+
guides(size = guide_legend(order = 1, "N.Articles"), alpha = guide_legend(order = 2, "TC per Year"))+
55+
theme(text = element_text(color = "#444444")
56+
,panel.background = element_rect(fill = 'gray97')
57+
,panel.grid.minor = element_line(color = '#FFFFFF')
58+
,panel.grid.major = element_line(color = '#FFFFFF')
59+
,plot.title = element_text(size = 24)
60+
,axis.title = element_text(size = 14, color = '#555555')
61+
,axis.title.y = element_text(vjust = 1, angle = 0, face="bold")
62+
,axis.title.x = element_text(hjust = .95, face="bold")
63+
,axis.text.x = element_text(face="bold")
64+
,axis.text.y = element_text(face="bold")
65+
)+
66+
labs(title="Top-Authors' Productivity over the Time",
67+
x="Author",
68+
y="Year")+
69+
geom_line(data=df2, aes(x = df2$Author, y = df2$year),size=1.0, color="firebrick", alpha=0.3 )+
70+
scale_x_discrete(limits = rev(levels(df2$Author)))+
71+
coord_flip()
72+
res <- list(dfAU=df2,graph=g)
73+
if (isTRUE(graph)){plot(g)}
74+
return(res)
75+
}
76+

R/biblioshiny.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
#' @export
1111

1212
biblioshiny <- function(){
13+
1314
runApp(system.file("biblioshiny",package="bibliometrix"),launch.browser = TRUE)
1415
}

R/networkPlot.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ networkPlot<-function(NetMatrix, normalize=NULL, n=NULL, degree=NULL, Title="Plo
9090

9191

9292
# vertex labels
93-
V(bsk.network)$name <- colnames(NET)
93+
V(bsk.network)$name <- tolower(colnames(NET))
9494

9595

9696
# Compute node degrees (#links) and use that to set node size:
@@ -164,6 +164,8 @@ networkPlot<-function(NetMatrix, normalize=NULL, n=NULL, degree=NULL, Title="Plo
164164
if (q<0){q=0}
165165
q=quantile(V(bsk.network)$deg,q)
166166
LABEL[V(bsk.network)$deg<q]=""
167+
V(bsk.network)$labelsize=10
168+
V(bsk.network)$labelsize[V(bsk.network)$deg<q]=0
167169
}
168170
}
169171

@@ -195,13 +197,13 @@ networkPlot<-function(NetMatrix, normalize=NULL, n=NULL, degree=NULL, Title="Plo
195197
plot(net_groups,bsk.network1, rescale=T, asp=0, ylim=c(-1,1), xlim=c(-1,1), layout = l, edge.curved=curved,
196198
vertex.label.dist = 0.7, vertex.frame.color = adjustcolor('black',alpha), vertex.label.color = adjustcolor('black',min(c(1,alpha+0.1))),
197199
vertex.color=adjustcolor(V(bsk.network1)$color,alpha),
198-
vertex.label.font = 2, vertex.label = tolower(LABEL), main=Title)
200+
vertex.label.font = 2, vertex.label = LABEL, main=Title)
199201

200202
}else{
201203
plot(bsk.network1, rescale=T, asp=0, ylim=c(-1,1), xlim=c(-1,1), layout = l, edge.curved=curved,
202204
vertex.label.dist = 0.7, vertex.frame.color = adjustcolor('black',alpha),
203205
vertex.color=adjustcolor(V(bsk.network1)$color,alpha),vertex.label.color = adjustcolor(lab.color, min(c(1,alpha+0.2))),
204-
vertex.label.font = 2, vertex.label = tolower(LABEL), main=Title, edge.color=adjustcolor(E(bsk.network1)$color,alpha/2))
206+
vertex.label.font = 2, vertex.label = LABEL, main=Title, edge.color=adjustcolor(E(bsk.network1)$color,alpha/2))
205207
}
206208

207209
}else{net_groups$modularity=rep(1,vcount(bsk.network))}
@@ -214,7 +216,7 @@ networkPlot<-function(NetMatrix, normalize=NULL, n=NULL, degree=NULL, Title="Plo
214216
} else {cluster_res=NA}
215217

216218

217-
net=list(graph=bsk.network, graph_pajek=bsk.save, cluster_obj=net_groups, cluster_res=cluster_res,layout=l)
219+
net=list(graph=bsk.network1, graph_pajek=bsk.save, cluster_obj=net_groups, cluster_res=cluster_res,layout=l)
218220

219221
return(net)}
220222

R/summary.bibliometrix.R

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ summary.bibliometrix<-function(object, ...){
4646
if (sum(names(arguments)=="pause")==0){pause=FALSE} else {pause=arguments$pause}
4747
if (sum(names(arguments)=="width")==0){options(width=120)} else {options(width=arguments$width)}
4848
if (sum(names(arguments)=="verbose")==0){verbose=TRUE} else {verbose=FALSE}
49-
49+
K=k
5050
Co=NULL
5151
AC=NULL
5252

@@ -118,6 +118,9 @@ summary.bibliometrix<-function(object, ...){
118118

119119
# Most Productive Authors
120120
if (isTRUE(verbose)){cat("\nMost Productive Authors\n\n")}
121+
if (K==Inf){
122+
k=length(object$Authors)
123+
}
121124
A=data.frame(cbind(object$Authors[1:k]))
122125
A$MPA=row.names(A);A=A[,c(2,1)]
123126
A[,3:4]=object$AuthorsFrac[1:k,]
@@ -132,6 +135,9 @@ summary.bibliometrix<-function(object, ...){
132135

133136
# Most Cited Manuscipts
134137
if (isTRUE(verbose)){cat("\nTop manuscripts per citations\n\n")}
138+
if (K==Inf){
139+
k=dim(object$MostCitedPapers)[1]
140+
}
135141
MostCitedPapers=object$MostCitedPapers[1:k,]
136142
MostCitedPapers=format(MostCitedPapers,justify="left",digits=3)
137143
row.names(MostCitedPapers)=1:k
@@ -140,7 +146,9 @@ summary.bibliometrix<-function(object, ...){
140146
if (pause==TRUE & isTRUE(verbose)){
141147
cat("Hit <Return> to see next table: ")
142148
line <- readline()}
143-
149+
if (K==Inf){
150+
k=length(object$Countries)
151+
}
144152
kk=k
145153
if (!is.null(object$Countries)){
146154
# Most Productive Countries
@@ -190,6 +198,9 @@ summary.bibliometrix<-function(object, ...){
190198
if (!is.null(object$Sources)){
191199
# Most relevant Sources
192200
if (isTRUE(verbose)){cat("\nMost Relevant Sources\n\n")}
201+
if (K==Inf){
202+
k=length(object$Sources)
203+
}
193204
kk=k
194205
if (length(object$Sources)<k){kk=length(object$Sources)}
195206
AA=data.frame(cbind(object$Sources[1:kk]))
@@ -208,6 +219,9 @@ summary.bibliometrix<-function(object, ...){
208219
if (!is.null(object$ID) & !is.null(object$DE)){
209220
# Most relevant Keywords
210221
if (isTRUE(verbose)){cat("\nMost Relevant Keywords\n\n")}
222+
if (K==Inf){
223+
k=min(c(length(object$DE),length(object$ID)))
224+
}
211225
AAA=data.frame(cbind(object$DE[1:k]))
212226
AAA$MPA=row.names(AAA);AAA=AAA[,c(2,1)]
213227
names(AAA)=c("DE Keywords ", "Articles")

0 commit comments

Comments
 (0)