Skip to content

Reformat match matrix #14

@AlexNikic

Description

@AlexNikic

Currently when you call match_instruments(instrument), the object match_response$matches is in the form of a list of lists. A lot of users are using boiler plate code to reformat this into a readable dataframe object.

df <- data.frame(match_response$matches[[1]])
for (x in seq_along(match_response$matches)) {
    df[x, ] <- match_response$matches[[x]]
}

colnames(df) <- lapply(match_response$questions, function(x) paste(x$question_no, x$question_text, sep = " "))
rownames(df) <- lapply(match_response$questions, function(x) paste(x$question_no, x$question_text, sep = " "))

It would be good to have this built into the library. Then we can visualise the dataframe using heatmap(as.matrix(df)). This can also be included in any example or tutorial notebooks.

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