rosetta: Combine imperfectly matched datasets

Description Usage Arguments Value Examples

View source: R/rosetta.r

Description

Forms a complete dataset through latent class concatenation of imperfectly matched dataset features.

Usage

1
rosetta(d, factor_structure)

Arguments

d

A list of dataframes with imperfectly matched features.

factor_structure

A named list. The list names are the factor names. Each element is a character vector of feature names for the corresponding factor.

Value

List of dataframes which contain factor scores.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#----------------------------------------------------------------------------
# Rosetta example
#----------------------------------------------------------------------------
library(rosetta)

# simulate data
d <- sim()

# check feature names
lapply(d$missing, names)

# run rosetta
d_rosetta <- rosetta(
  d = d$missing,
  factor_structure = list(
    a = c("a_1", "a_2", "a_3"),
    b = c("b_1", "b_2", "b_3"),
    c = c("c_1", "c_2", "c_3")
  )
)

bklamer/rosetta documentation built on Nov. 4, 2019, 7:31 a.m.