Documentation needed.

Documentation needed.

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 #> spdf 2283.022 2438.7015 3026.7003 2544.383 2774.969 50279.673 499 #> agentMat 692.630 730.0550 906.2804 759.472 836.013 7649.569 499 #> agentMatDirect 674.379 697.2235 827.9025 720.424 801.267 6680.988 499 #> cld #> b #> a #> a