Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor collapsing elements #209

Closed
4 tasks done
wibeasley opened this issue May 29, 2018 · 0 comments
Closed
4 tasks done

refactor collapsing elements #209

wibeasley opened this issue May 29, 2018 · 0 comments
Assignees

Comments

@wibeasley
Copy link
Member

wibeasley commented May 29, 2018

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()
@wibeasley wibeasley self-assigned this May 29, 2018
wibeasley added a commit that referenced this issue May 29, 2018
in preparation for #209
wibeasley added a commit that referenced this issue May 29, 2018
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

No branches or pull requests

1 participant