Skip to contents

Converts supported objects into a claim_df.

Usage

as_claim_df(x)

# S3 method for class 'data.frame'
as_claim_df(x)

Arguments

x

An object to coerce.

Value

A claim_df.

Examples

andorra_gdp <- data.frame(
  scope = "country=AD;year=2023",
  subject = "country",
  predicate = "GDP",
  value = "3.73 billion EUR"
)

as_claim_df(andorra_gdp)
#> <claim_df>
#> Claims: 1
#> Scopes: 1
#> Scope: country=AD;year=2023
#> 
#> # A tibble: 1 × 4
#>   scope                subject predicate value           
#>   <chr>                <chr>   <chr>     <chr>           
#> 1 country=AD;year=2023 country GDP       3.73 billion EUR

latin_box <- data.frame(
  scope = "box45",
  subject = "page",
  predicate = "language",
  value = "Latin"
)

as_claim_df(latin_box)
#> <claim_df>
#> Claims: 1
#> Scopes: 1
#> Scope: box45
#> 
#> # A tibble: 1 × 4
#>   scope subject predicate value
#>   <chr> <chr>   <chr>     <chr>
#> 1 box45 page    language  Latin