Skip to content

Create new class for handling input parameters #13

Description

@zkamvar

Currently the way to enter parameters for matching data is quite awkward as it a list of lists:

funlist <- list(
             list(d1vars = "ID",
                  d2vars = "ID",
                  fun = "nameDists",
                  extraparams = NULL,
                  weight = 1),
             list(d1vars = c("Surname", "OtherNames"),
                  d2vars = c("SurnameLab", "OtherNameLab"),
                  fun = "nameDists",
                  extraparams = NULL,
                  weight = 0.5)
           )

Instead of this monstrosity, it could be converted into a couple of S4 class objects and given accessors (and subsetters like "[["). This way the process could be something like:

IDparam <- new("paramclass", fun = "nameDists")
NAMEparam <- new("paramclass", fun = "nameDists")

vars(IDparam)     <- list("ID", "ID")
vars(NAMEparam)   <- list(c("Surname", "OtherNames"), c("SurnameLab", "OtherNameLab"))
weight(IDparam)   <- 1
weight(NAMEparam) <- 0.5

funlist <- new("epiclass", IDparam, NAMEparam)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions