Skip to content

Conversation

@hlageek
Copy link
Contributor

@hlageek hlageek commented Aug 5, 2025

As requested in #161.
New (sub)module to import codebooks from rectangular format (CSV/TSV) files.
Relies on a modal wizard, which gives users some leeway in how their import file is formatted.
Includes basic checks such as properly specified colors or unique code names.

At present, the following is supported:

  • code name (required)
  • code description (optional)
  • code color (optional)

Although this works and can be useful for some use cases, I think we need further steps to consider this feature complete:

  • parsing categories
  • include code color in Requal codebook export

These extensions will enable complete circulation of Requal codebooks via CSVs.

Also, when supported by Requal, we need to implement the following:

  • parsing code paths for code hierarchy

@hlageek hlageek requested a review from skvrnami August 5, 2025 15:21
if (
is.numeric(color) && length(color) == 3 && all(color >= 0 & color <= 255)
) {
return(paste0("rgb(", paste(color, collapse = ", "), ")"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this can happen if you import dataset from csv?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point 😅 but actually for quoted character values it is possible. We could give up on this check for simplicity's sake.

@hlageek hlageek merged commit cb539e1 into main Aug 8, 2025
4 checks passed
@hlageek hlageek deleted the codebook-csv-import branch August 17, 2025 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants