# \donttest{
f_obs <- tempfile(fileext = ".vtr")
f_sp <- tempfile(fileext = ".vtr")
f_ct <- tempfile(fileext = ".vtr")
write_vtr(data.frame(sp_id = 1:3, ct_code = c("AT", "DE", "FR"),
value = 10:12), f_obs)
write_vtr(data.frame(sp_id = 1:3,
name = c("Oak", "Beech", "Pine")), f_sp)
write_vtr(data.frame(ct_code = c("AT", "DE", "FR"),
gdp = c(400, 3800, 2700)), f_ct)
s <- vtr_schema(
fact = tbl(f_obs),
species = link("sp_id", tbl(f_sp)),
country = link("ct_code", tbl(f_ct))
)
print(s)
unlink(c(f_obs, f_sp, f_ct))
# }
Run the code above in your browser using DataLab