Learn R Programming

gcite (version 0.11.0)

gcite_citation_page: Parse Google Citation Index

Description

Parses a google citation indices (h-index, etc.) from main page

Usage

gcite_citation_page(doc, title = NULL, force = FALSE, ...)

# S3 method for xml_nodeset gcite_citation_page(doc, title = NULL, force = FALSE, ...)

# S3 method for xml_document gcite_citation_page(doc, title = NULL, force = FALSE, ...)

# S3 method for character gcite_citation_page(doc, title = NULL, force = FALSE, ...)

# S3 method for list gcite_citation_page(doc, title = NULL, force = FALSE, ...)

# S3 method for default gcite_citation_page(doc, title = NULL, force = FALSE, ...)

Value

A matrix of indices

Arguments

doc

A xml_document or the url for the main page

title

title of the article

force

If passing a URL and there is a failure, should the program return NULL?

...

arguments passed to GET

Examples

Run this code
library(httr)
library(rvest)
url = paste0("https://scholar.google.com/citations?view_op=view_citation&", 
"hl=en&oe=ASCII&user=T9eqZgMAAAAJ&pagesize=100&", 
"citation_for_view=T9eqZgMAAAAJ:W7OEmFMy1HYC")
url = gcite_url(url = url, pagesize = 10, cstart = 0) 
if (!is_travis() & !is_cran()) {
ind = gcite_citation_page(url)
doc = content(httr::GET(url))
ind = gcite_citation_page(doc)
ind_nodes = html_nodes(doc, "#gsc_oci_table div")
ind_nodes = html_nodes(ind_nodes, xpath = '//div[@class = "gs_scl"]')  
ind = gcite_citation_page(ind_nodes)
}

Run the code above in your browser using DataLab