applyFnToMarkers {Mega2R} | R Documentation |
apply a function to the genotypes from a set of markers
Description
A matrix of the genotypes for all the specified markers is generated. Then, the call back function, op
,
is called with the markers, NULL (for the range), and the 'environment'.
Usage
applyFnToMarkers(op = function (markers, range, envir) {},
markers_arg,
envir = ENV)
Arguments
op |
Is a function of three arguments. It will be called once by
|
markers_arg |
a data frame with the following 5 observations:
|
envir |
an 'environment' that contains all the data frames created from the SQLite database. |
Value
None
Examples
db = system.file("exdata", "seqsimm.db", package="Mega2R")
ENV = read.Mega2DB(db)
show = function(m, r, e) {
print(r)
print(m)
print(head(getgenotypes(m, envir = e)))
}
# apply function "show" to all genotypes > 5,000,000 bp
applyFnToMarkers(show, ENV$markers[ENV$markers$position > 5000000,])