Character. Indicates type of index tree to be created. Currently
only "quad" (quad trees) is supported.
dataType
Character. Indicates type of data being indexed. Currently "point",
and "rect" are supported corresponding to points and rectangles,
respectively. Defaults to "point".
columns
Numeric. Indicates columns in data the information to be
indexed can be found. Length depends on value of dataType (2
for "point" and 4 for "rect"). Defaults to columns 1 and 2. See Details.
...
Any additional/type specific parameters to be passed to the tree
creation function. These include:
maxDepth:
Numeric. Maximum depth of the tree. Defaults to 7.
minNodeArea:
Numeric. Minimum (rectangular) area to be represented by a
single node. When set, this overrides maxDepth
Details
For a point based tree, the two columns specified in columns
represent the x and y values of the points.
For a rectangle based tree, four columns must be specified. These
columns represent the x and y coordinates of point 1 and the x and y
coordinates of point 2, in that order (where point 1 and point 2
specify the rectangle to be stored).
Value
The class of the returned object depends on the tree type created,
though all will inherit from the SearchTree S4 class and have the
following slots:
ref
An external pointer to the C level data structure.
numNodes
Total number of nodes comprising the tree.
dataNodes
Number of nodes which store at least
one data point.
maxDepth
Maximum depth of the tree.
maxBucket
Maximum number of data points stored in a single
node.
totalData
Number of items indexed in the tree.
dataType
Type of objects stored in the tree.
Author(s)
Gabriel Becker
References
Finkel, R. A. and Bentley, J. L. "Quad Trees, a Data Structure for Retrieval on Composite Keys." Acta Informatica 4, 1-9, 1974.
See Also
SearchTreelinkS4Class{QuadTree}
Examples
x = rnorm(100)
y = rnorm(100)
dat = cbind(x,y)
tree = createTree(dat)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(SearchTrees)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/SearchTrees/createTree.Rd_%03d_medium.png", width=480, height=480)
> ### Name: createTree
> ### Title: Create a Search Tree Index
> ### Aliases: createTree
> ### Keywords: indexing quadtree
>
> ### ** Examples
>
> x = rnorm(100)
> y = rnorm(100)
> dat = cbind(x,y)
> tree = createTree(dat)
>
>
>
>
>
> dev.off()
null device
1
>