View source: R/harmonize_roles.R
| harmonize_roles | R Documentation |
Runs detect_roles() name-blind on each site and reports, per role, which
column each site holds, plus descriptive consistency checks (value type, event
coding, group-label overlap, range overlap, battery size). Alignment is by role
only; column names appear only in the returned cells. The residual
covariate role is excluded from map, checks and
site_only. aligned means the detector found the role at every site; it does not establish that the columns measure the same thing; read checks (levels, Jaccard, ranges) before pooling. Cell order is alphabetical and carries no pairing direction.
harmonize_roles(sites)
## S3 method for class 'role_harmonization'
print(x, ...)
## S3 method for class 'role_harmonization'
summary(object, ...)
sites |
A named list (unique, non-empty names) of at least two data.frames. |
x, object |
A |
... |
Ignored. |
An object of class "role_harmonization": a list with map
(role, status, one column per site), checks (role, check, one column per
site, flag), site_only (site, role, columns), n_sites and
sites. Flags are type_mismatch, coding_mismatch and
size_mismatch; no numeric threshold decides a flag. summary
returns map.
set.seed(1)
mk <- function(n) data.frame(id = seq_len(n), arm = sample(c("a", "b"), n, TRUE),
x = rnorm(n), y = rnorm(n))
harmonize_roles(list(north = mk(60), south = mk(80)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.