## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.width = 7,
                      fig.height = 4.2, dpi = 96, fig.align = "center")
library(rfair)

## ----eval = FALSE-------------------------------------------------------------
# # (needs network) assess any DOI / PID / URL:
# x <- assess_fair("https://doi.org/10.5281/zenodo.8347772")

## -----------------------------------------------------------------------------
data(fair_example)
x <- fair_example
x

## ----fig.alt = "FAIR scorecard: horizontal bars for Findable, Accessible, Interoperable and Reusable, plus an overall FAIR bar."----
plot(x)

## ----fig.height = 5.6, fig.alt = "Per-metric FAIR breakdown: one horizontal bar per metric, grouped by category."----
plot(x, type = "metric")

## ----fig.width = 6, fig.height = 5.4, fig.alt = "Concentric FAIR sunburst: inner ring of F/A/I/R categories, outer ring of individual metrics, overall percentage in the center."----
plot(x, type = "sunburst")

## -----------------------------------------------------------------------------
summary(x)

## -----------------------------------------------------------------------------
df <- as.data.frame(x)
head(df, 8)

## -----------------------------------------------------------------------------
df[df$earned < df$total, c("metric_identifier", "metric_name", "earned", "total")]

## -----------------------------------------------------------------------------
x$reuse$licenses[[1]][c("license", "category", "rdp_category")]

## -----------------------------------------------------------------------------
x$access[c("access", "controlled_access", "sensitive")]

## -----------------------------------------------------------------------------
x$identifier_hygiene[c("scheme", "is_persistent", "hygiene_ok")]

## -----------------------------------------------------------------------------
js <- as_fuji_json(x)
substr(js, 1, 220)

## -----------------------------------------------------------------------------
rdf <- as_rdf(x)
substr(rdf, 1, 220)

