Learn R Programming

mvbutils (version 1.1.1)

README.mvbutils: How to use mvbutils

Description

For how to use mvbutils, see the DETAILS section below.

Usage

README.mvbutils()

Arguments

Details

mvbutils is a collection of utilities offering the following main features:
  • Hierarchical organization of projects and sub-projects, allowing switching within a singleRsession, searching and moving objects through the hierarchy, objects in ancestor projects always visible from child (sub)projects, etc. Seecd.
  • Improved function editing facilities, interfacing with whichever text editor you prefer. TheRcommand line is not frozen while editing, and you can have multiple edit windows open. There is also a complete automatic text backup system, with (as a side-effect) the ability to sort functions by date. Seefixr.
  • "Lazy loading" for individual objects, allowing fast & efficient access to collections of biggish objects where only a few objects are used at a time. Seemlazy.
  • Support for flat-format (plain-text) documentation, stored along with a function and editable at the same time, and viewable through normalhelp. Automatic conversion to Rd format is available if certain rules are followed. Seeflatdoc.
  • Support for nesting ofsourcecalls, and for interspersingRcode and data in the same file. Seesource.mvb.
  • Support for easy macro-like functions which act in their caller's environment (see also RNews 1/3), and for "dynamically scoped" functions. Seemlocalanddo.in.envir.
  • Graphical display of which functions call which other functions. Seefoodweb.
There are also numerous lower-level utility functions and operators: see ?"mvbutils-utils" and ?"mvbutils-operators". To get the full features of mvbutils (in particular, the project organization), you need to start Rin the same directory every time (your "ROOT task"), and then switch to whichever project from inside R; see cd. Various options always need to be set to make fixr and the debug package work the way you want, so one advantage of the start-in-the-same directory-approach is that you can keep all your project-independent options(), library loads, etc., in a single .First function, called automatically when you start R. However, most features (including support for the debug package) will probably work even if you don't follow this suggestion. On loading, mvbutils creates a new environment in the search path, called mvb.session.info, which stores some housekeeping information. mvb.session.info is never written to disk, and disappears when the Rsession finishes. [For Splus users: mvb.session.info is similar to frame 0.] You should never change anything in mvb.session.info by hand, but it is sometimes useful to look at some of the variables there:
  • .First.top.searchis the directoryRstarted in (your ROOT task).
  • .Pathshows the currently-attached part of the task hierarchy.
  • base.xxxis the original copy of an overwritten system function, e.g.help
  • fix.listkeeps track of functions being edited viafixr
  • session.start.timeis the value ofSys.time()whenmvbutilswas loaded
  • source.listis used bysource.mvbto allow nesting of sources
  • traceesis used by thedebugpackage to store debugging information
  • r.window.handleis used by thehandypackage (Windows only)

See Also

cd, fixr, mlazy, flatdoc, dochelp, formalize.package, source.mvb, mlocal, do.in.envir, foodweb, clip, mvbutils-operators, mvbutils-utils, package debug