Talk:Opasnet (R library)

From Testiwiki
Revision as of 12:10, 11 June 2012 by Teemu R (talk | contribs)
Jump to: navigation, search

-- Teemu R 12:20, 11 June 2012 (EEST)

How to read discussions

Statements: Further developement

Resolution: Under discussion (to be changed when a conclusion is found)

(A stable resolution, when found, should be updated to the main page.)

Argumentation:

Whenever a new general methodology is being developed, the single most important goal in my opinion would be to make it as practical as possible. Inpractical methodolgies never live for long. Hence to define our goal I'll try to describe my ideal practical methodology for building variables and assessments.

The ovariable format has already been defined and all methods and functions should be built around that.

My idea is as follows: All variable pages can have 4 components

  • Data (in a data-table)
  • Formula, defined in unrunnable R code (Init functions, whatever it's called)
  • Dependencies, defined in the same code as formula
  • Ovariable definition, in the same code as formula and dependencies
    • It is the container for all of the above points, mainly defined on the page expilicitly because it easy and would otherwise require extra lines in fetch code.

Whenever upstream variables are required, usually in variable formula or assessment code, a 'fetch' function is called, which takes the dependencies as an argument. 'Fetch' then takes the arguments and checks whether they already exist in memory and if not uses the 'include' function to get the ovariable definition from the relevant page and evaluates the 'output' slot (by using interpret(data) and/or the formula + dependencies) for it and writes the completed ovariable to the global memory.

--# : Problem is, include cannot be put inside R code. It is part of the wiki rcode-tag. And allowing parsing and evaluating of character strings could be dangerous. --Teemu R 14:52, 11 June 2012 (EEST)

--# : Apparently there are functions called objects.put and objects.get that could be used to divert this problem. They can be used to save and load R variables from the server. --Teemu R 15:10, 11 June 2012 (EEST)

Marginals need to be taken into account somehow. When evaluating ovariables upstream mariginals could limit the amount of data received (when sources are combined or dropped). They could be somehow supplied upstream, or just defined on the page.