knitr::opts_chunk$set( collapse = TRUE, cache = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of lens2r is to get Lens.org scholar data into R environment. You need Lens.org scholar API token to access data, you can get one here.
Scholarly Search and Analysis
Lens serves over 200 million scholarly records, compiled and harmonised from Microsoft Academic, PubMed and Crossref, enhanced with UnPaywall open access information, CORE full text and links to ORCID. The full scholarly citation graph is provided for the first time as an open public resource.
🔬🔬🔬🔬 UNDER CONSTRUCTION 🛠⛔️⚠️🔩
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("sbalci/lens2r")
library(lens2r) request <- '{ "query": { "match_phrase": { "author.affiliation.name": "Harvard University" } }, "size": 1, "sort": [{ "year_published": "desc" }] }' data <- lens2r::get_scholarly_data(query = request) output_content <- httr::content(data, "text") output_flatten <- jsonlite::fromJSON(output_content, flatten = TRUE) output_flatten_data <- output_flatten$data output_flatten_data output_flatten <- as.data.frame(output_flatten) output_flatten
A package to access patent data from the Lens Patent Database Deprecated
https://github.com/poldham/lensr
https://github.com/poldham/covidlens
Scientific and Patent Literature on Covid-19 Corona Virus from the Lens for R https://poldham.github.io/covidlens/
https://docs.api.lens.org/samples.html#r
These are the basic codes this package uses
require(httr) getScholarlyData <- function(token, query){ url <- 'https://api.lens.org/scholarly/search' headers <- c('Authorization' = token, 'Content-Type' = 'application/json') httr::POST(url = url, add_headers(.headers=headers), body = query) } token <- 'your-access-token' request <- '{ "query": { "match_phrase": { "author.affiliation.name": "Harvard University" } }, "size": 1, "sort": [{ "year_published": "desc" }] }' data <- getScholarlyData(token, request) content(data, "text")
Follow @serdarbalci
Buy me a coffee
https://paypal.me/serdarbalci
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.