|
10 | 10 | #' "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.
|
11 | 11 | #' i.e for the authors SEMPRONIO TIZIO CAIO and ARIA MASSIMO \code{elements} argument is \code{elements = c("SEMPRONIO TC", "ARIA M")}.
|
12 | 12 | #' @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. |
14 | 14 | #' @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.
|
15 | 15 | #'
|
16 | 16 | #'
|
|
45 | 45 | #'
|
46 | 46 | #' @export
|
47 | 47 |
|
48 |
| -Hindex <- function(M, field="author", elements=NULL, sep = ";",years=10){ |
| 48 | +Hindex <- function(M, field="author", elements=NULL, sep = ";",years=Inf){ |
49 | 49 |
|
50 | 50 | #elements=paste("\\\b",elements,"\\\b",sep="")
|
51 | 51 | M$TC <- as.numeric(M$TC)
|
52 | 52 | 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)) |
54 | 54 | #M <- M[M$TC>0,]
|
55 | 55 |
|
56 | 56 | Today=as.numeric(substr(Sys.time(),1,4))
|
@@ -87,7 +87,6 @@ Hindex <- function(M, field="author", elements=NULL, sep = ";",years=10){
|
87 | 87 | group_by(.data$AUs) %>%
|
88 | 88 | summarize(#Element = .data$AUs[1],
|
89 | 89 | h_index = h_calc(.data$TC),
|
90 |
| - #h_index = which(1:length(.data$TC) >= sort(.data$TC,decreasing = T))[1]-1, |
91 | 90 | g_index = g_calc(.data$TC),
|
92 | 91 | PY_start = min(.data$PY),
|
93 | 92 | TC = sum(.data$TC),
|
|
0 commit comments