diff --git a/NAMESPACE b/NAMESPACE index 8ebd3b0e..e89d17b9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -197,6 +197,7 @@ importFrom(dplyr,relocate) importFrom(dplyr,rename) importFrom(dplyr,rename_with) importFrom(dplyr,right_join) +importFrom(dplyr,row_number) importFrom(dplyr,rowwise) importFrom(dplyr,select) importFrom(dplyr,slice) @@ -233,6 +234,7 @@ importFrom(igraph,E) importFrom(igraph,V) importFrom(igraph,arpack_defaults) importFrom(igraph,as_adjacency_matrix) +importFrom(igraph,as_long_data_frame) importFrom(igraph,authority_score) importFrom(igraph,betweenness) importFrom(igraph,centr_betw) diff --git a/R/cocMatrix.R b/R/cocMatrix.R index 4cb0fcfa..fdf84d83 100644 --- a/R/cocMatrix.R +++ b/R/cocMatrix.R @@ -1,9 +1,10 @@ -#' Occurrence Matrix +#' Bibliographic bipartite network matrices #' -#' \code{cocMatrix} computes occurences between elements of a Tag Field from a bibliographic data frame. Manuscript is the unit of analysis. +#' \code{cocMatrix} computes occurrences between elements of a Tag Field from a bibliographic data frame. Manuscript is the unit of analysis. #' -#' This occurrence matrix can be transformed into a collection of compatible -#' networks. Through matrix multiplication you can obtain different networks. +#' This occurrence matrix represents a bipartite network which can be transformed into a collection of bibliographic +#' networks such as coupling, co-citation, etc.. +#' #' The function follows the approach proposed by Batagelj & Cerinsek (2013) and Aria & cuccurullo (2017).\cr\cr #' #' References:\cr @@ -36,22 +37,22 @@ #' @param short is a logical. If TRUE all items with frequency<2 are deleted to reduce the matrix size. #' @param remove.terms is a character vector. It contains a list of additional terms to delete from the documents before term extraction. The default is \code{remove.terms = NULL}. #' @param synonyms is a character vector. Each element contains a list of synonyms, separated by ";", that will be merged into a single term (the first word contained in the vector element). The default is \code{synonyms = NULL}. -#' @return a co-occurrence matrix with cases corresponding to manuscripts and variables to the +#' @return a bipartite network matrix with cases corresponding to manuscripts and variables to the #' objects extracted from the Tag \code{Field}. #' #' @examples -#' # EXAMPLE 1: Articles x Authors co-occurrence matrix +#' # EXAMPLE 1: Articles x Authors occurrence matrix #' #' data(scientometrics, package = "bibliometrixData") #' WA <- cocMatrix(scientometrics, Field = "AU", type = "sparse", sep = ";") #' -#' # EXAMPLE 2: Articles x Cited References co-occurrence matrix +#' # EXAMPLE 2: Articles x Cited References occurrence matrix #' #' # data(scientometrics, package = "bibliometrixData") #' #' # WCR <- cocMatrix(scientometrics, Field = "CR", type = "sparse", sep = ";") #' -#' # EXAMPLE 3: Articles x Cited First Authors co-occurrence matrix +#' # EXAMPLE 3: Articles x Cited First Authors occurrence matrix #' #' # data(scientometrics, package = "bibliometrixData") #' # scientometrics <- metaTagExtraction(scientometrics, Field = "CR_AU", sep = ";") @@ -68,10 +69,10 @@ cocMatrix<-function(M, Field = "AU", type = "sparse", n=NULL, sep = ";",binary=T # # The function creates occurrences data between Works and Field # - # type indicates the output format of co-occurrences: + # type indicates the output format of occurrences: # "matrix" argument generates a W x Field sparse matrix # "sparse" argument generates a compact representation of the matrix (using the package Matrix) - # it represents a compact representation of a co-occurrences matrix. + # it represents a compact representation of a occurrences matrix. # Field indicates the ISI Tag # if Field is AU -> WA (Works x Authors) # if Field is CR -> WR (Works x References) diff --git a/R/collabByRegionPlot.R b/R/collabByRegionPlot.R index dd4b01b4..c31b9d4b 100644 --- a/R/collabByRegionPlot.R +++ b/R/collabByRegionPlot.R @@ -1,5 +1,6 @@ -#' A function to plot country collaboration networks by Region -#' The function \code{\link{networkPlot}} can plot a bibliographic network previously created by \code{\link{biblioNetwork}}. +#' Country Collaboration Networks by Region +#' +#' A function to create and plot country collaboration networks by Region #' #' @param NetMatrix is a country collaboration matrix obtained by the function \code{\link{biblioNetwork}}. #' @param normalize is a character. It can be "association", "jaccard", "inclusion","salton" or "equivalence" to obtain Association Strength, Jaccard, @@ -55,7 +56,9 @@ #' #' NetMatrix <- biblioNetwork(management, analysis = "collaboration", network = "countries") #' -#' net <- collabByRegionPlot(NetMatrix, edgesize = 4, label.cex = TRUE, labelsize=2.5, weighted = TRUE, size=0.5, size.cex=TRUE, community.repulsion = 0, verbose=FALSE) +#' net <- collabByRegionPlot(NetMatrix, edgesize = 4, label.cex = TRUE, labelsize=2.5, +#' weighted = TRUE, size=0.5, size.cex=TRUE, community.repulsion = 0, +#' verbose=FALSE) #' #' cbind(names(net)) #' diff --git a/R/histPlot.R b/R/histPlot.R index 4a966189..43cb46fb 100644 --- a/R/histPlot.R +++ b/R/histPlot.R @@ -149,14 +149,53 @@ histPlot<-function(histResults, n=20, size = 5, labelsize = 5, title_as_label = layout_m$y <- (diff(range(layout_m$x))/diff(range(layout_m$y)))*layout_m$y ################ - df_net <- dataFromIgraph(bsk.network, layout=as.matrix(layout_m[c("x","y")]), niter=50000, arrow.gap=0) + # df_net <- dataFromIgraph(bsk.network, layout=as.matrix(layout_m[c("x","y")]), niter=50000, arrow.gap=0) + # df_net$color <- "slategray1" + # df_net <- left_join(df_net,layout_m[c("name","color")], by = "name") %>% + # rename( + # color = .data$color.x, + # color_v =.data$color.y + # ) + # #names(df_net)[10:11] <- c("color", "color_v") + + df_net <- igraph::as_long_data_frame(bsk.network) df_net$color <- "slategray1" - df_net <- left_join(df_net,layout_m[c("name","color")], by = "name") %>% + + ID <- setdiff(df_net$to,df_net$from) + + df_from <- df_net %>% + select(.data$from,.data$to,.data$color,.data$from_name, .data$from_title, .data$from_keywords, .data$from_keywordsplus, .data$from_id, .data$from_size, .data$from_years) + + df_to <- df_net %>% dplyr::filter(.data$to %in% ID) %>% + mutate(from2=.data$to) %>% + select(.data$from2,.data$to,.data$color,.data$to_name, .data$to_title, .data$to_keywords, .data$to_keywordsplus, .data$to_id, .data$to_size, .data$to_years) + + df_to <- df_to[!duplicated(df_to$to),] + + label <- c("from", "to", "color","name", "title", "keywords", "keywordsplus", "id", "size", "years") + + names(df_from) <- label + names(df_to) <- label + + df_net <- rbind(df_from,df_to) + + layout_norm <- layout_m %>% + mutate(x = (.data$x-min(.data$x))/(max(.data$x)-min(.data$x)), + y = (.data$y-min(.data$y))/(max(.data$y)-min(.data$y))) + df_net <- left_join(df_net,layout_norm[c("name","color","x","y")], by = c("name" ="name")) %>% rename( color = .data$color.x, color_v =.data$color.y - ) - #names(df_net)[10:11] <- c("color", "color_v") + ) + + df_coord <- layout_norm %>% + mutate(to=row_number()) %>% + select(.data$to,.data$x,.data$y) %>% + rename(xend=.data$x, + yend=.data$y) + + df_net <- df_net %>% + left_join(df_coord, by="to") ylength <- diff(range(df_net$years))+1 Ylabel <- (as.character(seq(min(df_net$years),max(df_net$years),length.out=ylength))) diff --git a/R/zzz.R b/R/zzz.R index d008d4d1..db73e5f0 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -17,6 +17,7 @@ #' @import tidytext #' @importFrom dplyr %>% #' @importFrom dplyr across +#' @importFrom dplyr row_number #' @importFrom dplyr tibble #' @importFrom dplyr as_tibble #' @importFrom dplyr between @@ -95,6 +96,7 @@ #' @importFrom factoextra fviz_cluster #' @importFrom factoextra fviz_dend #' @importFrom factoextra hcut +#' @importFrom igraph as_long_data_frame #' @importFrom igraph get.edgelist #' @importFrom igraph graph_from_data_frame #' @importFrom igraph as_adjacency_matrix @@ -287,159 +289,159 @@ biblioshiny()\n") } -### extract data from igraph class object -### Credits to François Briatte. Function is a fork of the package ggnetwork -dataFromIgraph <- function( - model, - data = NULL, - layout = igraph::nicely(), - arrow.gap = ifelse(igraph::is.directed(model), 0.025, 0), - by = NULL, - scale = TRUE, - stringsAsFactors = getOption("stringsAsFactors"), - ... -) { - # node placement - if (inherits(layout, "matrix") && identical(dim(layout), c(igraph::gorder(model), 2L))) { - nodes <- layout[, 1:2 ] - } else if (inherits(layout, "matrix")) { - stop("layout matrix dimensions do not match network size") - } else { - nodes <- igraph::layout_(model, layout, ...) - } - - format_igraph( - model = model, - nodes = nodes, - weights = "none", - arrow.gap = arrow.gap, - by = by, - scale = scale, - stringsAsFactors = stringsAsFactors, - .list_vertex_attributes_fun = igraph::list.vertex.attributes, - .get_vertex_attributes_fun = igraph::get.vertex.attribute, - .list_edges_attributes_fun = igraph::list.edge.attributes, - .get_edges_attributes_fun = igraph::get.edge.attribute, - .as_edges_list_fun = igraph::as_edgelist - ) -} - -### Credits to François Briatte. Function is a fork of the package ggnetwork -format_igraph <- function( - model, - nodes = NULL, - weights = NULL, - arrow.gap = ifelse(network::is.directed(model), 0.025, 0), - by = NULL, - scale = TRUE, - stringsAsFactors = getOption("stringsAsFactors"), - .list_vertex_attributes_fun = NULL, - .get_vertex_attributes_fun = NULL, - .list_edges_attributes_fun = NULL, - .get_edges_attributes_fun = NULL, - .as_edges_list_fun = NULL -) { - # store coordinates - nodes <- data.frame(nodes) - colnames(nodes) <- c("x", "y") - - # rescale coordinates - if (scale) { - nodes$x <- scale_data(nodes$x) - nodes$y <- scale_data(nodes$y) - } - - # import vertex attributes - if (length(.list_vertex_attributes_fun(model)) > 0) { - nodes <- cbind.data.frame( - nodes, - sapply( - X = .list_vertex_attributes_fun(model), - Y = model, - FUN = function(X, Y) .get_vertex_attributes_fun(Y, X), - simplify = FALSE - ), - stringsAsFactors = stringsAsFactors - ) - } - - # edge list - if (inherits(model, "igraph")) { - edges <- .as_edges_list_fun(model, names = FALSE) - } else { - edges <- .as_edges_list_fun(model, attrname = weights) - } - - # edge list (if there are duplicated rows) - if (nrow(edges[, 1:2, drop = FALSE]) > nrow(unique(edges[, 1:2, drop = FALSE]))) { - warning("duplicated edges detected") - } - - edges <- data.frame(nodes[edges[, 1], c("x", "y")], nodes[edges[, 2], c("x", "y")]) - colnames(edges) <- c("x", "y", "xend", "yend") - - # arrow gap (thanks to @heike and @ethen8181 for their work on this issue) - if (arrow.gap > 0) { - x.length <- edges$xend - edges$x - y.length <- edges$yend - edges$y - arrow.gap <- arrow.gap / sqrt(x.length^2 + y.length^2) - edges$xend <- edges$x + (1 - arrow.gap) * x.length - edges$yend <- edges$y + (1 - arrow.gap) * y.length - } - - # import edge attributes - if (length(.list_edges_attributes_fun(model)) > 0) { - edges <- cbind.data.frame( - edges, - sapply( - X = .list_edges_attributes_fun(model), - Y = model, - FUN = function(X, Y) .get_edges_attributes_fun(Y, X), - simplify = FALSE - ), - stringsAsFactors = stringsAsFactors - ) - } - - if (nrow(edges) > 0) { - # drop "na" columns created by 'network' methods - # this is to ensure consistency with 'igraph' methods - if ("na" %in% colnames(nodes)) nodes$na <- NULL - if ("na" %in% colnames(edges)) edges$na <- NULL - - # merge edges and nodes data - edges <- merge(nodes, edges, by = c("x", "y"), all = TRUE) - - # add missing columns to nodes data - nodes$xend <- nodes$x - nodes$yend <- nodes$y - # names(nodes) <- names(edges)[1:ncol(nodes)] # columns are already named from 'nodes' and 'edges' - - # make nodes data of identical dimensions to edges data - nodes[, setdiff(names(edges), names(nodes))] <- NA - - # panelize nodes (for temporal networks) - if (!is.null(by)) { - nodes <- lapply(sort(unique(edges[, by])), function(x) { - y <- nodes - y[, by] <- x - y - }) - nodes <- do.call(rbind, nodes) - } - - return(unique(rbind(edges[!is.na(edges$xend), ], nodes))) - } else { - # add missing columns to nodes data - nodes$xend <- nodes$x - nodes$yend <- nodes$y - return(nodes) - } -} - - -### scale coordinates -### Credits to François Briatte. Function is a fork of the package ggnetwork +# ### extract data from igraph class object +# ### Credits to François Briatte. Function is a fork of the package ggnetwork +# dataFromIgraph <- function( +# model, +# data = NULL, +# layout = igraph::nicely(), +# arrow.gap = ifelse(igraph::is.directed(model), 0.025, 0), +# by = NULL, +# scale = TRUE, +# stringsAsFactors = getOption("stringsAsFactors"), +# ... +# ) { +# # node placement +# if (inherits(layout, "matrix") && identical(dim(layout), c(igraph::gorder(model), 2L))) { +# nodes <- layout[, 1:2 ] +# } else if (inherits(layout, "matrix")) { +# stop("layout matrix dimensions do not match network size") +# } else { +# nodes <- igraph::layout_(model, layout, ...) +# } +# +# format_igraph( +# model = model, +# nodes = nodes, +# weights = "none", +# arrow.gap = arrow.gap, +# by = by, +# scale = scale, +# stringsAsFactors = stringsAsFactors, +# .list_vertex_attributes_fun = igraph::list.vertex.attributes, +# .get_vertex_attributes_fun = igraph::get.vertex.attribute, +# .list_edges_attributes_fun = igraph::list.edge.attributes, +# .get_edges_attributes_fun = igraph::get.edge.attribute, +# .as_edges_list_fun = igraph::as_edgelist +# ) +# } +# +# ### Credits to François Briatte. Function is a fork of the package ggnetwork +# format_igraph <- function( +# model, +# nodes = NULL, +# weights = NULL, +# arrow.gap = ifelse(network::is.directed(model), 0.025, 0), +# by = NULL, +# scale = TRUE, +# stringsAsFactors = getOption("stringsAsFactors"), +# .list_vertex_attributes_fun = NULL, +# .get_vertex_attributes_fun = NULL, +# .list_edges_attributes_fun = NULL, +# .get_edges_attributes_fun = NULL, +# .as_edges_list_fun = NULL +# ) { +# # store coordinates +# nodes <- data.frame(nodes) +# colnames(nodes) <- c("x", "y") +# +# # rescale coordinates +# if (scale) { +# nodes$x <- scale_data(nodes$x) +# nodes$y <- scale_data(nodes$y) +# } +# +# # import vertex attributes +# if (length(.list_vertex_attributes_fun(model)) > 0) { +# nodes <- cbind.data.frame( +# nodes, +# sapply( +# X = .list_vertex_attributes_fun(model), +# Y = model, +# FUN = function(X, Y) .get_vertex_attributes_fun(Y, X), +# simplify = FALSE +# ), +# stringsAsFactors = stringsAsFactors +# ) +# } +# +# # edge list +# if (inherits(model, "igraph")) { +# edges <- .as_edges_list_fun(model, names = FALSE) +# } else { +# edges <- .as_edges_list_fun(model, attrname = weights) +# } +# +# # edge list (if there are duplicated rows) +# if (nrow(edges[, 1:2, drop = FALSE]) > nrow(unique(edges[, 1:2, drop = FALSE]))) { +# warning("duplicated edges detected") +# } +# +# edges <- data.frame(nodes[edges[, 1], c("x", "y")], nodes[edges[, 2], c("x", "y")]) +# colnames(edges) <- c("x", "y", "xend", "yend") +# +# # arrow gap (thanks to @heike and @ethen8181 for their work on this issue) +# if (arrow.gap > 0) { +# x.length <- edges$xend - edges$x +# y.length <- edges$yend - edges$y +# arrow.gap <- arrow.gap / sqrt(x.length^2 + y.length^2) +# edges$xend <- edges$x + (1 - arrow.gap) * x.length +# edges$yend <- edges$y + (1 - arrow.gap) * y.length +# } +# +# # import edge attributes +# if (length(.list_edges_attributes_fun(model)) > 0) { +# edges <- cbind.data.frame( +# edges, +# sapply( +# X = .list_edges_attributes_fun(model), +# Y = model, +# FUN = function(X, Y) .get_edges_attributes_fun(Y, X), +# simplify = FALSE +# ), +# stringsAsFactors = stringsAsFactors +# ) +# } +# +# if (nrow(edges) > 0) { +# # drop "na" columns created by 'network' methods +# # this is to ensure consistency with 'igraph' methods +# if ("na" %in% colnames(nodes)) nodes$na <- NULL +# if ("na" %in% colnames(edges)) edges$na <- NULL +# +# # merge edges and nodes data +# edges <- merge(nodes, edges, by = c("x", "y"), all = TRUE) +# +# # add missing columns to nodes data +# nodes$xend <- nodes$x +# nodes$yend <- nodes$y +# # names(nodes) <- names(edges)[1:ncol(nodes)] # columns are already named from 'nodes' and 'edges' +# +# # make nodes data of identical dimensions to edges data +# nodes[, setdiff(names(edges), names(nodes))] <- NA +# +# # panelize nodes (for temporal networks) +# if (!is.null(by)) { +# nodes <- lapply(sort(unique(edges[, by])), function(x) { +# y <- nodes +# y[, by] <- x +# y +# }) +# nodes <- do.call(rbind, nodes) +# } +# +# return(unique(rbind(edges[!is.na(edges$xend), ], nodes))) +# } else { +# # add missing columns to nodes data +# nodes$xend <- nodes$x +# nodes$yend <- nodes$y +# return(nodes) +# } +# } +# +# +# ### scale coordinates +# ### Credits to François Briatte. Function is a fork of the package ggnetwork scale_data <- function(x, scale = diff(range(x))) { if (!scale) { x <- rep(0.5, length.out = length(x)) @@ -450,8 +452,8 @@ scale_data <- function(x, scale = diff(range(x))) { } -## Plot edges using ggplot2 -### Credits to François Briatte. Function is a fork of the package ggnetwork +# ## Plot edges using ggplot2 +# ### Credits to François Briatte. Function is a fork of the package ggnetwork geom_network_edges <- function( mapping = NULL, data = NULL, @@ -479,7 +481,7 @@ geom_network_edges <- function( ... ) } - + ggplot2::layer( data = data, mapping = mapping, @@ -492,7 +494,7 @@ geom_network_edges <- function( ) } -### Credits to François Briatte. Function is a fork of the package ggnetwork +# ### Credits to François Briatte. Function is a fork of the package ggnetwork geom_network_nodes <- function( mapping = NULL, data = NULL, @@ -516,8 +518,8 @@ geom_network_nodes <- function( ) ) } - -### Credits to François Briatte. Function is a fork of the package ggnetwork +# +# ### Credits to François Briatte. Function is a fork of the package ggnetwork StatEdges <- ggplot2::ggproto("StatEdges", ggplot2::Stat, compute_layer = function(data, scales, params) { unique(subset(data, !(x == xend & y == yend))) diff --git a/inst/CITATION b/inst/CITATION index 260be81c..f0ca8238 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,14 +1,12 @@ -citHeader("To cite bibliometrix in publications, please use:") - -citEntry(entry = "article", - author = "Massimo Aria and Corrado Cuccurullo", - title = "bibliometrix: An R-tool for comprehensive science mapping analysis", - journal = "Journal of Informetrics", - volume = "11", - number = "4", - pages = "959-975", - publisher = "Elsevier", - year = "2017", - url = "https://doi.org/10.1016/j.joi.2017.08.007", - textVersion = "Aria, M. & Cuccurullo, C. (2017) bibliometrix: An R-tool for comprehensive science mapping analysis, Journal of Informetrics, 11(4), pp 959-975, Elsevier." -) \ No newline at end of file +citHeader("To cite bibliometrix in publications, please use:") + +bibentry(bibtype="Article", + title = "bibliometrix: An R-tool for comprehensive science mapping analysis", + author = "Massimo Aria and Corrado Cuccurullo", + journal = "Journal of Informetrics", + year = "2017", + doi = "10.1016/j.joi.2017.08.007", + textVersion = + paste("Aria, M., & Cuccurullo, C. (2017),", + "bibliometrix: An R-tool for comprehensive science mapping analysis,", + "Journal of informetrics, 11(4), 959-975, Elsevier.")) diff --git a/inst/biblioshiny/server.R b/inst/biblioshiny/server.R index 8ced31c7..d4b0e496 100644 --- a/inst/biblioshiny/server.R +++ b/inst/biblioshiny/server.R @@ -2191,7 +2191,7 @@ server <- function(input, output,session){ g=ggplot2::ggplot(AuProd, aes(x = .data$N.Articles, y = .data$Freq*100, text=paste("N.Articles: ",.data$N.Articles,"\n% of production: ",round(.data$Freq*100,1)))) + geom_line(aes(group="NA")) + - geom_area(aes(group="NA"),fill = 'grey90', alpha = .5) + + #geom_area(aes(group="NA"),fill = 'grey90', alpha = .5) + geom_line(data=AuProd, aes(y=.data$Theoretical*100, group="NA"),linetype = "dashed",color="black",alpha=0.8)+ xlim(0,max(AuProd$N.Articles)+1)+ labs(x = 'Documents written' @@ -2698,7 +2698,7 @@ server <- function(input, output,session){ } else { xx=xx[order(-xx[,3]),] xx=xx[1:k,c(1,3)] - laby="N. of Citations per Year" + laby="Average Article Citations" } g <- freqPlot(xx,x=2,y=1, textLaby = "Countries", textLabx = laby, title = "Most Cited Countries", values) diff --git a/inst/biblioshiny/ui.R b/inst/biblioshiny/ui.R index 21c04873..2c6d298d 100644 --- a/inst/biblioshiny/ui.R +++ b/inst/biblioshiny/ui.R @@ -1523,7 +1523,7 @@ body <- dashboardBody( selectInput("CitCountriesMeasure", label = "Measure", choices = c("Total Citations"="TC", - "Average Citations per Year"="TCY"), + "Average Article Citations"="TCY"), selected = "TC"), numericInput("MostCitCountriesK", label=("Number of Countries"), diff --git a/inst/biblioshiny/utils.R b/inst/biblioshiny/utils.R index 85f235c4..dedf2202 100644 --- a/inst/biblioshiny/utils.R +++ b/inst/biblioshiny/utils.R @@ -454,7 +454,7 @@ descriptive <- function(values,type){ rename(Country = .data$AU1_CO, TotalCitation = .data$TC) %>% group_by(.data$Country) %>% - summarise("TC"=sum(.data$TotalCitation),"Average Article Citations"=sum(.data$TotalCitation)/length(.data$TotalCitation)) %>% + summarise("TC"=sum(.data$TotalCitation),"Average Article Citations"=round(sum(.data$TotalCitation)/length(.data$TotalCitation),1)) %>% arrange(-.data$TC) %>% as.data.frame(.data,stringasfactor=FALSE) }, "tab7"={ @@ -1280,7 +1280,7 @@ hist2vis<-function(net, labelsize = 2, nodesize= 2, curved=FALSE, shape="dot", o LABEL[igraph::V(net$net)$labelsize==0] <- "" layout <- net$layout %>% - dplyr::select(.data$x,.data$y,.data$color,.data$name) + dplyr::select(.data$x,.data$y,.data$color,.data$name) vn <- visNetwork::toVisNetworkData(net$net) diff --git a/man/Hindex.Rd b/man/Hindex.Rd index ec97a4fc..67fb4f71 100644 --- a/man/Hindex.Rd +++ b/man/Hindex.Rd @@ -4,7 +4,7 @@ \alias{Hindex} \title{h-index calculation} \usage{ -Hindex(M, field = "author", elements = NULL, sep = ";", years = 10) +Hindex(M, field = "author", elements = NULL, sep = ";", years = Inf) } \arguments{ \item{M}{is a bibliographic data frame obtained by the converting function \code{\link{convert2df}}. @@ -19,7 +19,7 @@ i.e for the authors SEMPRONIO TIZIO CAIO and ARIA MASSIMO \code{elements} argume \item{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 = ";"}.} -\item{years}{is a integer. It indicates the number of years to consider for Hindex calculation. Default is 10.} +\item{years}{is a integer. It indicates the number of years to consider for Hindex calculation. Default is Inf.} } \value{ 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. diff --git a/man/cocMatrix.Rd b/man/cocMatrix.Rd index 5db95fc3..f466aa5d 100644 --- a/man/cocMatrix.Rd +++ b/man/cocMatrix.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/cocMatrix.R \name{cocMatrix} \alias{cocMatrix} -\title{Occurrence Matrix} +\title{Bibliographic bipartite network matrices} \usage{ cocMatrix( M, @@ -52,15 +52,16 @@ column of the data frame. The default is \code{sep = ";"}.} \item{synonyms}{is a character vector. Each element contains a list of synonyms, separated by ";", that will be merged into a single term (the first word contained in the vector element). The default is \code{synonyms = NULL}.} } \value{ -a co-occurrence matrix with cases corresponding to manuscripts and variables to the +a bipartite network matrix with cases corresponding to manuscripts and variables to the objects extracted from the Tag \code{Field}. } \description{ -\code{cocMatrix} computes occurences between elements of a Tag Field from a bibliographic data frame. Manuscript is the unit of analysis. +\code{cocMatrix} computes occurrences between elements of a Tag Field from a bibliographic data frame. Manuscript is the unit of analysis. } \details{ -This occurrence matrix can be transformed into a collection of compatible -networks. Through matrix multiplication you can obtain different networks. +This occurrence matrix represents a bipartite network which can be transformed into a collection of bibliographic +networks such as coupling, co-citation, etc.. + The function follows the approach proposed by Batagelj & Cerinsek (2013) and Aria & cuccurullo (2017).\cr\cr References:\cr @@ -68,18 +69,18 @@ Batagelj, V., & Cerinsek, M. (2013). On bibliographic networks. Scientometrics, Aria, M., & Cuccurullo, C. (2017). bibliometrix: An R-tool for comprehensive science mapping analysis. Journal of Informetrics, 11(4), 959-975.\cr } \examples{ -# EXAMPLE 1: Articles x Authors co-occurrence matrix +# EXAMPLE 1: Articles x Authors occurrence matrix data(scientometrics, package = "bibliometrixData") WA <- cocMatrix(scientometrics, Field = "AU", type = "sparse", sep = ";") -# EXAMPLE 2: Articles x Cited References co-occurrence matrix +# EXAMPLE 2: Articles x Cited References occurrence matrix # data(scientometrics, package = "bibliometrixData") # WCR <- cocMatrix(scientometrics, Field = "CR", type = "sparse", sep = ";") -# EXAMPLE 3: Articles x Cited First Authors co-occurrence matrix +# EXAMPLE 3: Articles x Cited First Authors occurrence matrix # data(scientometrics, package = "bibliometrixData") # scientometrics <- metaTagExtraction(scientometrics, Field = "CR_AU", sep = ";") diff --git a/man/collabByRegionPlot.Rd b/man/collabByRegionPlot.Rd index 0b5deb9a..c9574ee2 100644 --- a/man/collabByRegionPlot.Rd +++ b/man/collabByRegionPlot.Rd @@ -2,8 +2,7 @@ % Please edit documentation in R/collabByRegionPlot.R \name{collabByRegionPlot} \alias{collabByRegionPlot} -\title{A function to plot country collaboration networks by Region -The function \code{\link{networkPlot}} can plot a bibliographic network previously created by \code{\link{biblioNetwork}}.} +\title{Country Collaboration Networks by Region} \usage{ collabByRegionPlot( NetMatrix, @@ -104,8 +103,7 @@ It is a list containing the following elements: \code{cluster_res} \tab \tab a data frame with main results of clustering procedure.\cr} } \description{ -A function to plot country collaboration networks by Region -The function \code{\link{networkPlot}} can plot a bibliographic network previously created by \code{\link{biblioNetwork}}. +A function to create and plot country collaboration networks by Region } \examples{ @@ -116,7 +114,9 @@ management <- metaTagExtraction(management, Field = "AU_CO") NetMatrix <- biblioNetwork(management, analysis = "collaboration", network = "countries") -net <- collabByRegionPlot(NetMatrix, edgesize = 4, label.cex = TRUE, labelsize=2.5, weighted = TRUE, size=0.5, size.cex=TRUE, community.repulsion = 0, verbose=FALSE) +net <- collabByRegionPlot(NetMatrix, edgesize = 4, label.cex = TRUE, labelsize=2.5, + weighted = TRUE, size=0.5, size.cex=TRUE, community.repulsion = 0, + verbose=FALSE) cbind(names(net))