chrisadolph / tile-simcf

R packages for visualizing statistical models, with tools for counterfactual simulation
faculty.washington.edu/cadolph/software
13 stars 10 forks source link

tile Input Checks and Error Messages #7

Open chrisadolph opened 12 years ago

chrisadolph commented 12 years ago

tile presently does little to check for acceptable inputs, and (mostly as a result) gives nonsensical error messages. tallestGrob error, anyone?

Checks need to happen at least in three ways: checks for each trace, to make sure inputs are feasible for that trace type, checks for tile parameters, to make sure they are possible for a tile plot, and, most difficult, checks for each input to a trace or tile itself conditional on the full range of other inputs to traces and tile.

We never want to accidentally exclude inputs that would work, so if you're unsure if something is an error (just unwise), use warning() instead of error().

ghost commented 12 years ago

I think I could assist in developing some of these checks -- because I haven't used tile very much, a table such as the following would be quite helpful:

input required class1 class2 classn comments x 1 list array matrix must be same length as y color 0 list
plot 1 list must be distinct from other traces

Would it be possible to get my hands on something like that? Thanks.

chrisadolph commented 12 years ago

That's the sort of thing that would be nice to make!

Some notes on the below:

  1. Inputs are strictly required if there is no default. To check if there is no default for an input to an R function, look at the function definition. If you see:

myfunc <- function(x, y=20) { some stuff }

then x is a required input, but y is not (it has a default, 20).

  1. The plot input does not need to be distinct from other traces.
    The plot input says on which plot or plots the trace will be displayed.
    You could plot more than one trace to the same plot. You could also plot a trace to more than one plot (the plot argument can be a vector).
  2. color is usually a vector, not a list
  3. x is usually a vector, not a list. In R, there is nothing formally called an array.
  4. plot is a vector, not a list.
  5. also, look at the help on each input. Usually much of this is answered there

Chris

On 1/29/12 11:45 PM, mikefree88 wrote:

I think I could assist in developing some of these checks -- because I haven't used tile very much, a table such as the following would be quite helpful:

input required class1 class2 classn comments x 1 list array matrix must be same length as y color 0 list
plot 1 list must be distinct from other traces

Would it be possible to get my hands on something like that? Thanks.


Reply to this email directly or view it on GitHub: https://github.com/chrisadolph/tile-simcf/issues/7#issuecomment-3715667