Created
May 25, 2017 06:56
-
-
Save andrawaag/52345c58c644c4a3cd9e623c5b8edfc3 to your computer and use it in GitHub Desktop.
R script that uses the WikidataQueryServiceR library. It scrapes the example from the Wikidata example page https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples. See line 4 on how
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(WikidataQueryServiceR) | |
library(rvest) | |
library(urltools) | |
sparql_query <- scrape_example(c("Variant counts by predictor type")) | |
results <- query_wikidata(sparql_query) | |
barplot(results$counts, main="Variant counts by predictor type", | |
las=2, names.arg=results$propertyLabel) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment