Skip to contents

Creates a harbour_dtable from scratch, so a set of R data frames can be written out as a SeaTable base and imported.

Usage

hb_dtable(..., base_name = "harbouR base", collaborators = NULL)

Arguments

...

Named data frames, one per table.

base_name

Name recorded for the base.

collaborators

Optional list of collaborator records.

Value

A harbour_dtable.

Details

Column types are inferred: character becomes text, numeric number, logical checkbox, Date and POSIXct date, factor single-select with its levels as options, and list-columns multiple-select.

Examples

base <- hb_dtable(
  Samples = data.frame(Name = c("a", "b"), Value = c(1.5, 2.5)),
  base_name = "My base"
)
base
#> 
#> ── <harbour_dtable> ────────────────────────────────────────────────────────────
#> • base : "My base"
#> • tables : 1
#> • rows : 2
#> • assets : 0
#> 
#> - Samples (2 cols, 2 rows)

hb_read_table(base, "Samples")
#> # A tibble: 2 × 3
#>   Name  Value `_id`                 
#>   <chr> <dbl> <chr>                 
#> 1 a       1.5 Rf6-A--hQtiVKoYftEUIlQ
#> 2 b       2.5 _gmfdKEQQ7eVXoBFobKtQA