Skip to contents

Writes a csdb_profile as YAML. read_profile() reads the file back to an object identical to profile.

Usage

write_profile(profile, path)

Arguments

profile

A csdb_profile, from profile_query().

path

The file to write. The function overwrites it.

Value

path, invisibly.

See also

Examples

d <- data.frame(sex = rep(c("female", "male"), 6))
p <- profile_data(d, c(sex = "TEXT"), columns = c(sex = "full"))
f <- write_profile(p, tempfile(fileext = ".yaml"))
cat(readLines(f), sep = "\n")
#> provenance:
#>   format: 1
#>   source: ~
#>   query: SELECT * FROM `profile_data`
#>   driver: SQLiteConnection
#>   profiled_at: '2026-11-17T14:35:14Z'
#>   k: 5
#>   noise: ~
#>   max_levels: 50
#>   csdb_version: 2026.11.17
#> field_types:
#>   sex: TEXT
#> keys: []
#> n_rows: 12
#> columns:
#>   sex:
#>     type: TEXT
#>     sensitivity: full
#>     missing_share: 0.0
#>     levels:
#>     - female
#>     - male
#>     'n':
#>     - 6
#>     - 6
#> group_sizes: []
#> crosstabs: []
#> dependencies: []
#> notes: []