From ripley at stats.ox.ac.uk  Wed Feb  7 19:48:30 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 7 Feb 2007 18:48:30 +0000 (GMT)
Subject: [Rd] manage R function and data dependencies like 'make'
In-Reply-To: <793FF35679078340BCDDA196B495E57E1F0968@spree.pcpool.mi.fu-berlin.de>
References: <793FF35679078340BCDDA196B495E57E1F0968@spree.pcpool.mi.fu-berlin.de>
Message-ID: <Pine.LNX.4.64.0702071845180.2816@gannet.stats.ox.ac.uk>

R-devel has file_test() in utils (earlier versions had a private version 
in tools).  That has a '-nt' op to do what you need.

file.info() accesses modification dates.

Having said that, I would use 'make' as for example R's own test suites 
do.

On Wed, 7 Feb 2007, Lutz Prechelt wrote:

> 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 at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



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