# Store path to source file in url variable.
url <- paste("https://www.ngdc.noaa.gov/nndc/struts/results?type_0=",
"Exact&query_0=$ID&t=101650&s=13&d=189&dfn=signif.txt",
sep = "")
# Create temporary file with .txt extension.
file <- tempfile(fileext = ".txt")
# Download source data to temporary file using url.
download.file(url, file, method = "curl")
# Read file to data frame.
earthquakes <- utils::read.delim2(file,
header = TRUE,
sep = "\t",
na.strings = c(""),
stringsAsFactors = FALSE)
# Save data frame to data directory.
usethis::use_data(earthquakes, overwrite = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.