MangroveTree {Mangrove} | R Documentation |
The MangroveTree class
Description
Functions to create, populate, summarise and utilise MangroveTree objects.
Usage
initialiseTree()
# Member functions:
# tree$addPed(ped,ORs)
# tree$getPrevs(ORs = NULL,K = NULL,overwrite=FALSE,iter=1000)
## S3 method for class 'MangroveTree'
print(x,...)
## S3 method for class 'MangroveTree'
summary(object,...)
## S3 method for class 'MangroveTree'
plot(x,...)
Arguments
tree |
An object of class |
x |
An object of class |
object |
An object of class |
ped |
An object of class \codeMangrovePed |
ORs |
An object of class |
K |
The prevalence of the disease (between 0 and 1, or NULL if not known) |
overwrite |
Logical. If set to FALSE, and sampling has already been performed, then existing samples will be used. If TRUE, sampling is performed again. |
iter |
Number of samples to draw from the posterior distribution of number of affecteds. |
... |
Arguments to be passed on to other methods. |
Details
The MangroveTree class is used for holding family trees, and for performing risk prediction on them. The initialiseTree
function creates an empty tree, and the tree$addPed
populates it from genetic data. You can then sample from the posterior distribution of number of affecteds using the tree$getPrevs
function.
The print
method writes a text version of the tree to screen, and the summary
method writes some basic information about what the tree contains, along with what calculations have and have not been performed on it. The plot
method is not implemented, and throws an error message.
To see an example of the use of this class, use vignette("Mangrove")
.
Value
For initialiseTree
, an empty object of class MangroveTree
. For the tree$getPrevs
class function, an object of class MangroveSample
.
For all other functions, nothing is returned.
See Also
MangrovePed
, MangroveORs
, MangroveSample
Examples
data(famped)
data(exampleORs)
tree <- initialiseTree()
tree$addPed(famped,exampleORs)
print(tree)
summary(tree)
sam <- tree$getPrevs(exampleORs,K=0.02)
summary(sam)