Error in install.packages(SPARQL): object 'SPARQL' not found
Traceback:

1. install.packages(SPARQL)
library(SPARQL) # SPARQL querying package
library(ggplot2)
Error in library(SPARQL): there is no package called ‘SPARQL’
Traceback:

1. library(SPARQL)
2. stop(txt, domain = NA)


# Step 1 - Set up preliminaries and define query
# Define the data.gov endpoint
endpoint <- "http://services.data.gov/sparql"
 
# create query statement
query <-
"PREFIX  dgp1187: <http://data-gov.tw.rpi.edu/vocab/p/1187/>
SELECT ?ye ?fi ?ac
WHERE {
?s dgp1187:year ?ye .
?s dgp1187:fires ?fi .
?s dgp1187:acres ?ac .
}"
 
# Step 2 - Use SPARQL package to submit query and save results to a data frame
qd <- SPARQL(endpoint,query)
df <- qd$results
 
# Step 3 - Prep for graphing
 
# Numbers are usually returned as characters, so convert to numeric and create a
# variable for "average acres burned per fire"
str(df)
df <- as.data.frame(apply(df, 2, as.numeric))
str(df)