Learn R Programming

documair (version 0.6-0)

change8names: changes object names in R script files

Description

Explores a series of R script files and modify them changing some objects names for new ones. Changes must be unambiguous; they are performed sequentially according to the order of nnames rows. Also, if some functions have got common names used in comments or messages, they will be changed as well since the syntaxic analysis made in rrrtext3places8word is very limited.

Usage

change8names(nfiles,nnames)

Arguments

nfiles
A two column character matrix, giving by row old and new names of files to consider. Old and new names can be identical.
nnames
A two column character matrix, giving by row old and new names of objects.

Value

character(0) if everything went right, if not, some warning messages.

Details

It is difficult to ensure that the modifications are perfect, but at least they can give a hand. Each file is dealt in turn. When old and new names of a file coincide, the old file is first saved into a temporary file suffixed with the moment of the saving and only destroyed at the end. So if something went wrong, you can recover the initial file.