Skip to content

Definition of "wrapper"?

3 messages · Bryan Hanson, Charilaos Skiadas, Gabor Grothendieck

#
I think I more or less understand what a ?wrapper? is, but I?d like to hear
how more experienced R users define it, and especially I'd like to know if
there is a formal definition.  In my reading, it seems like there are a
fairly wide range of meanings, but they are all conceptually similar.

I've looked in a couple of the classic R texts, the extensions and
developers' manuals, and R help archives, and didn't find a definition.  Of
course, I may have missed it.

Thanks in advance.  Bryan

**************
Bryan Hanson
Professor of Chemistry & Biochemistry
DePauw University
602 S. College Avenue
Greencastle, IN 46135
PHONE     765-658-4602
FAX     765-658-6084
hanson at depauw.edu
http://academic.depauw.edu/~hanson/deadpezsociety.html
http://www.depauw.edu/acad/chemistry/
http://academic.depauw.edu/~hanson/UMP/index.html
#
On Mar 30, 2008, at 2:51 PM, Bryan Hanson wrote:

            
This is a general programming question, likely. This might offer a  
starting point:
http://en.wikipedia.org/wiki/Wrapper_pattern

Greetings from Hanover, IN
Haris Skiadas
Department of Mathematics and Computer Science
Hanover College
#
The wrapper wraps, i.e. calls, another function that does the real
work but provides a different or more convenient (or more convenient
for a specific purpose) interface to it or specific syntax.  Often the wrapper
has the same arguments but different defaults and sometimes that
is referred to as a "convenience" wrapper.  Sometimes its used in
the sense of providing an R interface to a C function with essentially
similar arguments.

by is a wrapper to tapply which preprocesses the data in a way
that makes it acceptable to tapply, read.csv and Map are wrappers
to read.table and mapply which are the same but have different argument
defaults, sprintf is a wrapper to the C function of the same name,
%o% is a wrapper to outer.

I don't think there is a formalized definition within R -- the above is
based on current usage.
On Sun, Mar 30, 2008 at 2:51 PM, Bryan Hanson <hanson at depauw.edu> wrote: