Documentation needed.

Documentation needed.

Author

Eliot McIntire

Eliot McIntire

Examples

newAgent <- new("agentMatrix", coords = cbind(pxcor = c(1, 2, 5), pycor = c(3, 4, 6)), char = letters[c(1, 2, 6)], nums2 = c(4.5, 2.6, 2343), char2 = LETTERS[c(4, 24, 3)], nums = 5:7) newAgent <- new("agentMatrix", coords = cbind(pxcor = c(1, 2, 5), pycor = c(3, 4, 6)), char = letters[c(1, 2, 6)], nums2 = c(4.5, 2.6, 2343), char2 = LETTERS[c(4, 24, 3)], nums = 5:7) # compare speeds -- about 5x faster if(require(microbenchmark)) { microbenchmark(times = 499, spdf = {SpatialPointsDataFrame( coords = cbind(pxcor = c(1, 2, 5), pycor = c(3, 4, 6)), data = data.frame( char = letters[c(1, 2, 6)], nums2 = c(4.5, 2.6, 2343), char2 = LETTERS[c(4, 24, 3)], nums = 5:7))}, agentMat = {agentMatrix( coords = cbind(pxcor = c(1, 2, 5), pycor = c(3, 4, 6)), char = letters[c(1, 2, 6)], nums2 = c(4.5, 2.6, 2343), char2 = LETTERS[c(4, 24, 3)], nums = 5:7)}, agentMatDirect = {new("agentMatrix", coords = cbind(pxcor = c(1, 2, 5), pycor = c(3, 4, 6)), char = letters[c(1, 2, 6)], nums2 = c(4.5, 2.6, 2343), char2 = LETTERS[c(4, 24, 3)], nums = 5:7)}) }
#> Loading required package: microbenchmark
#> Unit: microseconds #> expr min lq mean median uq max neval cld #> spdf 930.581 967.1160 1051.5175 989.001 1093.4610 8708.024 499 b #> agentMat 252.480 267.8905 300.6846 282.440 306.0905 5866.813 499 a #> agentMatDirect 250.390 264.4750 282.9813 278.790 299.9200 449.060 499 a