Skip to content

Commit ffe3426

Browse files
authored
Merge pull request #299 from massimoaria/develop
Develop
2 parents b16074b + 7e25085 commit ffe3426

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

R/Hindex.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#' "author", the argument has the form C("SURNAME1 N","SURNAME2 N",...), in other words, for each author: surname and initials separated by one blank space. If elements=NULL, the function calculates impact indices for all elements contained in the data frame.
1111
#' i.e for the authors SEMPRONIO TIZIO CAIO and ARIA MASSIMO \code{elements} argument is \code{elements = c("SEMPRONIO TC", "ARIA M")}.
1212
#' @param sep is the field separator character. This character separates authors in each string of AU column of the bibliographic data frame. The default is \code{sep = ";"}.
13-
#' @param years is a integer. It indicates the number of years to consider for Hindex calculation. Default is 10.
13+
#' @param years is a integer. It indicates the number of years to consider for Hindex calculation. Default is Inf.
1414
#' @return an object of \code{class} "list". It contains two elements: H is a data frame with h-index, g-index and m-index for each author; CitationList is a list with the bibliographic collection for each author.
1515
#'
1616
#'
@@ -45,12 +45,12 @@
4545
#'
4646
#' @export
4747

48-
Hindex <- function(M, field="author", elements=NULL, sep = ";",years=10){
48+
Hindex <- function(M, field="author", elements=NULL, sep = ";",years=Inf){
4949

5050
#elements=paste("\\\b",elements,"\\\b",sep="")
5151
M$TC <- as.numeric(M$TC)
5252
M$PY <- as.numeric(M$PY)
53-
M <- M %>% dplyr::filter(!is.na(.data$TC))
53+
M <- M %>% dplyr::filter(!is.na(.data$TC) | !is.na(.data$TC))
5454
#M <- M[M$TC>0,]
5555

5656
Today=as.numeric(substr(Sys.time(),1,4))
@@ -87,7 +87,6 @@ Hindex <- function(M, field="author", elements=NULL, sep = ";",years=10){
8787
group_by(.data$AUs) %>%
8888
summarize(#Element = .data$AUs[1],
8989
h_index = h_calc(.data$TC),
90-
#h_index = which(1:length(.data$TC) >= sort(.data$TC,decreasing = T))[1]-1,
9190
g_index = g_calc(.data$TC),
9291
PY_start = min(.data$PY),
9392
TC = sum(.data$TC),

R/collabByRegionPlot.R

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ collabByRegionPlot <- function(
108108
n_regions <- length(regions)
109109

110110
net <- list()
111+
111112
for (i in regions){
112113
reg_co <- labelCo %>%
113114
dplyr::filter(.data$continent %in% i) %>%
@@ -119,11 +120,19 @@ collabByRegionPlot <- function(
119120
label = label, labelsize = labelsize, label.cex = label.cex, label.color = label.color, label.n = label.n,
120121
halo = halo, cluster = cluster, community.repulsion = community.repulsion, vos.path = NULL, size = size,
121122
size.cex = size.cex, curved = curved, noloops = noloops, remove.multiple = remove.multiple, remove.isolates = remove.isolates,
122-
weighted = weighted, edgesize = edgesize, edges.min = edges.min, alpha = alpha, verbose = verbose)
123-
if (verbose) plot(net[[i]]$graph)
124-
}
125-
net[[i]]$NetMatrix_reg <- NetMatrix_reg
123+
weighted = weighted, edgesize = edgesize, edges.min = edges.min, alpha = alpha, verbose = FALSE)
124+
net[[i]]$NetMatrix_reg <- NetMatrix_reg
125+
}
126+
126127
}
127128

129+
if (verbose){
130+
l <- ceiling(length(net)/2)
131+
par(mfrow=c(l,2))
132+
# for (i in 1:length(net)){
133+
# plot(net[[i]]$graph)
134+
# }
135+
lapply(net, function(x){plot(x$graph)})
136+
}
128137
return(net)
129138
}

R/summary.bibliometrix.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ summary.bibliometrix<-function(object, ...){
4242
options(width=130)
4343

4444
arguments <- list(...)
45-
if (sum(names(arguments)=="k")==0){k=10} else {k=arguments$k}
46-
if (sum(names(arguments)=="pause")==0){pause=FALSE} else {pause=arguments$pause}
47-
if (sum(names(arguments)=="width")==0){options(width=120)} else {options(width=arguments$width)}
48-
if (sum(names(arguments)=="verbose")==0){verbose=TRUE} else {verbose=FALSE}
49-
K=k
50-
Co=NULL
51-
AC=NULL
45+
if (sum(names(arguments)=="k")==0){k=10} else {k <- arguments$k}
46+
if (sum(names(arguments)=="pause")==0){pause <- FALSE} else {pause <- arguments$pause}
47+
if (sum(names(arguments)=="width")==0){options(width = 120)} else {options(width = arguments$width)}
48+
if (sum(names(arguments)=="verbose")==0){verbose <- TRUE} else {verbose <- FALSE}
49+
K <- k
50+
Co <- NULL
51+
AC <- NULL
5252

5353
TCm <- format(mean(as.numeric(object$TotalCitation), na.rm=TRUE),digits = 4)
5454
TCmy <- format(mean(as.numeric(object$MostCitedPapers$TCperYear), na.rm = TRUE), digits = 4)

0 commit comments

Comments
 (0)