Skip to content

add mechanism to create new variables #46

Description

@miserman

To allow for more custom data analysis and potentially reduce the size of loaded data (by not needing to include calculable variables), it could be nice to have a means of adding new variables, calculated from existing one.

Use Cases

  • Create totals from broken-out categories (e.g., total population from separate demographics variables).
  • Create percent variants from count categories (maybe using the created total).
  • Allow specification of custom variables (e.g., a female to male ratio from given female and male count variables).

Implementation

  • The main calculation mechanism should probably be in the DataHandler.
  • Could have at least 3 interfaces (where the new variable can be specified): R, browser UI, URL parameter.
  • For category-based variables, probably allow some sort of specification through measure info.
  • For custom variables, could be very free-form, which might involve some custom parsing (e.g., female_ratio = female / male, where variable names and operators would need to be recognized), or could be limited to a few pre-defined functions (e.g., a ratio function, with accepted inputs of two existing variables).
  • Might want a means of also specifying measure info for the new variable.

Stipulations

  • Would need to be treated as a regular variable throughout.
  • If new variables are to be available through the API, would need a means of passing custom specifications through the URL.
  • Will probably want new variables to be stored in local storage when specified through the browser.

Metadata

Metadata

Assignees

Labels

functionalityRelates to functionality (what can be done with the tools or sites)

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions