gcite_citation_page: Parse Google Citation Index

Description Usage Arguments Value Examples

View source: R/gcite_citation_page.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
gcite_citation_page(doc, title = NULL, force = FALSE, ...)

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

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

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

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

## Default S3 method:
gcite_citation_page(doc, title = NULL, force = FALSE, ...)

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

Value

A matrix of indices

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
if (!is_travis()) {
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) 
ind = gcite_citation_page(url)
doc = content(httr::GET(url))
ind = gcite_citation_page(doc)
ind_nodes = html_nodes(doc, "#gsc_vcd_table div")
ind_nodes = html_nodes(ind_nodes, xpath = '//div[@class = "gs_scl"]')  
ind = gcite_citation_page(ind_nodes)
}

muschellij2/gcite documentation built on Feb. 6, 2018, 7:45 a.m.