Description Usage Arguments Value S3 METHODS See Also Examples
The S+Proteome
module provides a wealth of preprocessing
functionality, some or all of which may be used as a preface
for subsequent classification investigations. This function
allows the user to document the processing pipeline by adding
text to a particular attribute of an object
that describes the current processing state.
Each process in the pipeline is referred to as an event.
This function will typically not be called directly by
the user and will alternatively be called from within
various preprocessing functions.
1 | eventHistory(x, ..., sub.label=" ", time.stamp=date(), action="append")
|
x |
an object of any class. |
... |
one or more named lists, each containing named character vectors describing
an event to register. Each list must be in the form
EventName = list(proc2="Description 1", proc2="Description 2") and so on.
Here, EventName is a character string defining the name of the event,
and the named list variables proc1 and proc2 are character strings
that define the specific proceedings for that event. Each of these proceedings
is descibed more thoroughly by the assigned character string.
If for a given event, the user wishes only to register the name
of the event sans extra proceedings information, it is allowable
to make the call ala |
action |
a character string defining the action to take with the new history information. Supported values are as follows:
Default: |
sub.label |
a character string used to preface the proceedings lines for each event
when a history summary is printed on the command line.
Default: |
time.stamp |
a character string defining a time stamp for the process(es) being documented.
This time stamp will be automatically added to each process in the event.
Default: |
a replication of the original object, with an attached attribute
of class eventHistory
containing a vector of formatted
character strings defining the processing history of the input object.
event data access. Input either a character string or an integer defining the registered event in the history.
pretty-prints the event history. Optional arguments for this method are
Character string to preface each event header.
Default: paste("[", attr(x, "index"), "]", sep = "")
.
assignEvent
, isProcessRecorded
, existHistory
, getHistory
, eventHistory
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | ## create a list of simple objects
z <- list(dog="chihuahua", vals=1:5, colors=c("red","green","blue"))
## remove mean from vals and document as a history
## event
z$vals <- z$vals - mean(z$vals)
z <- eventHistory(z, "Process A"=list(values="mean removed"))
## now sort the colors and change the dog name,
## and document both actions in the same call
## to msHistory as separate processes
z$colors <- sort(z$colors)
z$dog <- "pomeranian"
z <- eventHistory(z, "Process B"=list(colors="sorted alphabetically"),
"Process C"=list(dog="name change", result="more hair"))
## add an event without proceedings
z <- eventHistory(z, "Event A", "Event B")
## print the history
print(getHistory(z))
## replace some of the events with new information
z <- eventHistory(z, "Event A"=list(show="pony"), "Process A",
action="merge")
print(getHistory(z))
## prepend some new events
z <- eventHistory(z, new=list(alpha="first greek letter"),
action="prepend")
print(getHistory(z))
## replace event history altogether
z <- eventHistory(z, newest=list(omega="final greek letter"),
action="replace")
print(getHistory(z))
## return an object of class eventHistory, i.e.,
## not attached to any other object
eventHistory(NULL,
symphony=list(string="violins and cellos", percussion="drums",
reed="flutes and oboes"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.