capin: file

Description Usage Arguments Examples

View source: R/capin.R

Description

file

Usage

1
capin(x, meta = NULL)

Arguments

x

(character) a file path

meta

either a file path (character), rdf objet from package rdflib, or NULL

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# a file that's already on the web
x <- system.file("extdata", "vostok.icecore.co2", package = "contentid")
capin(x)
url <- 'https://cdiac.ess-dive.lbl.gov/ftp/trends/co2/vostok.icecore.co2'
capin(url)

# a file not on the web
w <- tempfile(fileext=".csv")
df <- data.frame(a = letters, b = LETTERS)
write.csv(df, file = w)
res <- capin(w)
res
contentid::query_sources(res)

# associate metadata with the data
x <- system.file("extdata", "vostok.icecore.co2", package = "contentid")
m <- system.file("examples/rdf_eg1.rdf", package = "capins")
capin(x, meta = m)

sckott/capins documentation built on Feb. 13, 2021, 12:55 a.m.