skiadas / PanthR

Statistics front-end and webserver with R connection
1 stars 2 forks source link

Referring to variables within a dataset in another object #21

Open skiadas opened 11 years ago

skiadas commented 11 years ago

As it stands, most Output Objects just require a list of names of the variables to be used. In theory those variables could be coming from different datasets, or could be standalone variables, as long as they have the same length. This would create some trouble with regards to names: A variable within a dataset could have the same name as a variable within another dataset.

Some possible ways to avoid the collision:

  1. Require that all variables for an object come from the same dataset. In that case we should make a reference to that dataset a part of the output object. Variables would have to be incorporated into the dataset in order to be included with other variables.
  2. Decide on a convention on variable names, that would indicate the dataset they come from. For instance a variable foo coming from dataset bar might be referred to with a name like: "bar@foo". Thinking here an at sign is a letter not likely to normally be used in either variable names or dataset names. But some other separated could just as well be used.
  3. A third alternative is to allow a 2 element array as an alternative to a variable. A standalone variable "foo" would be simple referred as such, but a variable "foo" inside the dataset bar would be represented by the array ["bar","foo"]