Skip to content

refactor collapsing elements #209

Closed
Closed
@wibeasley

Description

There are several places in several functions that repeat code like this.

  if( (length(fields_collapsed)==0L) | is.null(fields_collapsed) | all(nchar(fields_collapsed)==0L) )
    fields_collapsed <- ifelse(is.null(fields), "", paste0(fields, collapse=",")) #This is an empty string if `fields` is NULL.

Pull it out into a reusable & testable function.

  • redcap_read()
  • redcap_read_oneshot()
  • redcap_read_oneshot_eav()
  • redcap_metadata_read()

Activity

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

Metadata

Metadata

Assignees

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