[Rd] manage R function and data dependencies like 'make'

2007-02-07 Thread Lutz Prechelt
Dear R-devels,

I am looking for a package (or some other infrastructure) for the
following situation:

I am doing a larger data evaluation.
I have several dozen data files and do not want to keep the persistent
data in the R workspace (for robustness reasons).
I have several dozen R files, some for reading and preprocessing data
files, others for doing plots or analyses.
I will make frequent changes to both data files and R files while doing
the analysis.

I would like to automate mechanisms that allow 
- a data file reading function to suppress its actual work if neither
the data file nor the R file containing the function were modified since
the data file was last read
- an R file sourcing function to suppress its actual work if the R file
has not been modified
- and perhaps even: automate re-reading a data file upon access to the
corresponding dataframe iff the file has been modified since the
dataframe was created.

In short: Something like Unix's 'make', but for managing dependencies of
functions and dataframes in addition to files. In R. (And of course I am
very open for solutions that are more elegant than what I have sketched
above.)

I could not find something in the help and have rather few ideas for
good search terms.

I any such thing available?
(If no such infrastructure exists, what is the right R function for
accessing file modification dates?)

Thanks!

  Lutz

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] R CMD check: "T used instead of TRUE"

2006-05-18 Thread Lutz Prechelt
Hello everybody,
 
I am just trying to put together my first own CRAN-able package.
I have completed the programming and my code works OK.
But now when I perform
  R CMD check agsemisc_1.0-2.tar.gz
and R gets to the step
  * checking examples ...
I receive the following error message:
  > print(bwplot(Species~Sepal.Length, data=iris, panel=panel.bwstrip))
  Error in rep(T, length(x)) : T used instead of TRUE
which apparently complains about a use of T that occurs not 
in the example, but rather in the implementation of the function 
called by the example.

I have searched the R-devel archives for a reference to that
error message and in
https://stat.ethz.ch/pipermail/r-devel/2006-February/036520.html
found a mention of function cleanEx() that is
apparently generated by R CMD check(?) and that contains
  delayedAssign("T", stop("T used instead of TRUE"),
assign.env = .CheckExEnv)
  delayedAssign("F", stop("F used instead of FALSE"),
assign.env = .CheckExEnv)
(BTW: A rather fascinating feature. I would not have thought
 this possible.)

My questions:

- Is my perception correct that this is meant as a check
  for robust programming style? 
  (Because T might change while TRUE cannot?)
- Is it correct that I should change ALL occurrences of 
  T or F in my package code independent of their context?
  Or are there different kinds of contexts?
- Are there any other similar checks that are performed by
  R CMD check?
- I cannot find such a thing mentioned in Secion 1.3.1 of 
  R-exts.pdf that describes the actions of R CMD check.
  The most pertinent item appears to be number 13:
"The examples provided by the package's documentation are run."
  Would you say this is a documentation defect that I ought
  to report to R-bugs?

Any help is appreciated.
Thanks in advance,

  Lutz Prechelt

Prof. Dr. Lutz Prechelt; [EMAIL PROTECTED]
Institut fuer Informatik; Freie Universitaet Berlin
Takustr. 9; 14195 Berlin; Germany
+49 30 838 75115; http://www.inf.fu-berlin.de/inst/ag-se/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] R CMD check: checking examples: how to (not) pause execution

2006-05-18 Thread Lutz Prechelt
Hello all,
 
trying to prepare my first package for submission to CRAN 
I am stumbling over the "checking examples" step
of R CMD check.
 
I have some examples that produce more than one plot.
I currently separate those plot calls by
  readline("Press  for a plot including a density plot")
or some such to have R wait before producing the next plot.

This works OK for end users, but fails miserably 
during R CMD check, which appears to just eat the
next line of the example source file for the input of readline
(which took me quite a while to understand it).

What is the right way to solve this problem?

I can hardly believe that there is none (although the
examples of 'plot' suggest exactly this: They run 
through multiple plots in a hurry.)

I guess the appropriate approach would be if
example() had some kind of single-stepping option?

Any hints?

  Lutz Prechelt

P.S.: 
Documentation remark:
For users struggling with R CMD check it might be
very helpful if R-exts.pdf contained some pointers
to the functions or mechanisms used by R CMD check, 
or the names of source files where to find such information
so they can better understand what is going on.

Prof. Dr. Lutz Prechelt; [EMAIL PROTECTED]
Institut fuer Informatik; Freie Universitaet Berlin
Takustr. 9; 14195 Berlin; Germany
+49 30 838 75115; http://www.inf.fu-berlin.de/inst/ag-se/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Trellis equivalent of par(ask=TRUE)?

2006-05-18 Thread Lutz Prechelt
(was:  AW: [Rd] R CMD check: checking examples: how to (not) pause
execution)

Paul, Brian,
 
> > I think the more usual way to solve this is to have the user set 
> > par(ask=TRUE) is they want to be prompted.

thank you.
Looking back, 'par' would have been a likely candidate for looking.
One reason I did NOT look there is that I need the functionality
for print.trellis in fact, not for plot.
par(ask=TRUE) does not influence print.trellis.
trellis.par.get() does not have an equivalent for par(ask=).
Nor does gpar() or any other method in Grid that I could find.

I have tried to help myself (in an admittedly crude way) by putting
  \dontshow{plot(1,type="n")  # make R stop and ask}
before each Lattice plot call in my .Rd file.
But that does not work either. 
It leads to R CMD check output as follows:
  > par(ask=TRUE)
  > ## Don't show:
  > plot(1,type="n")  # make R stop and ask
  Press Return for next plot:## End Don't sh> ow
  Error: object "ow" not found
Rather weird.
Any ideas?
I am using R 2.2.1.

  Lutz Prechelt

Prof. Dr. Lutz Prechelt; [EMAIL PROTECTED]
Institut fuer Informatik; Freie Universitaet Berlin
Takustr. 9; 14195 Berlin; Germany
+49 30 838 75115; http://www.inf.fu-berlin.de/inst/ag-se/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel