Skip to content

Use best practices for checking input #19

@PabRod

Description

@PabRod

Dear @boutinb,

I am having difficulties solving a quite simple problem. I need a process to not start until both columns are specified:

Image

I've pushed my own artisanal solution (see here), or in pseudocode:

processTable <- function(jaspResults, dataset, options) {

  # Auxiliary function.
  # Returns TRUE if and only if an option has been assigned in the GUI
  .isAssigned <- function(option) {
    not_assigned <- as.character(option) == ""
    return(!not_assigned)
  }

  # Only if everything has been assigned ...
  if(.isAssigned(options$ts) && .isAssigned(options$xs)) {
    # ... do something, ...
  } else { # ... otherwise ...
   # ... inform the user about what's still missing
}

I'm sure we have helper functions for that in jaspBase (my best guess is .readDataSetToEnd()), but I didn't manage to wrap my head around how to use it.

Questions

  1. What would be your recommended solution?
  2. Is there any other documentation than this one.

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is neededquestionFurther information is requested

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions