I am trying to create a Brownian bridge movement model, for some animal tag data, project that I am working on, but I have trouble making it work. Since I am new with working with animal movement models in R, ChatGPT gave me the following code to use:
# Install and load the `move` package
install.packages("move")
library(move)
# Create a Move object using ID, date, latitude, longitude, and error radius
move_data <- move(x = data$LONGITUDE, y = data$LATITUDE, time = data$DATE,
animal = data$ID, error = data$ERROR_RADIUS)
# Fit the Brownian Bridge Movement Model
bbmm <- brownian.bridge.dyn(move_data, location.error = data$ERROR_RADIUS, raster = 100)
plot(bbmm)
Unfortunately, the last part didn't work, giving me the error:
Error in .local(object, raster, location.error = location.error, ext = ext, :
Lower x grid not large enough, consider extending the raster in that direction or enlarging the ext argument
I tried very different methods in order to make it work, but none of them worked and thus I am stuck.
I will provide the data that I am working on, for anyone that wants to work with it, here:
structure(list(DeployID = c(253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334, 253334, 253334,
253334, 253334, 253334, 253334, 253334, 253334), Date = structure(c(1697319465,
1697319644, 1697321729, 1697322492, 1697324665, 1697325959, 1697327340,
1697328630, 1697331991, 1697332860, 1697333519, 1697336443, 1697336624,
1697338995, 1697342346, 1697353803, 1697353894, 1697359768, 1697359949,
1697361038, 1697363331, 1697365436, 1697365863, 1697366850, 1697368174,
1697369287, 1697371368, 1697372928, 1697373943, 1697373972, 1697376385,
1697377440, 1697380039, 1697382306, 1697394473, 1697399038, 1697400298,
1697403634, 1697404658, 1697406294, 1697407382, 1697409807, 1697411633,
1697413490, 1697415864, 1697417617, 1697418529, 1697418739, 1697420073,
1697421816, 1697424674, 1697426127, 1697431927, 1697437883, 1697443629,
1697444479, 1697446168, 1697448091, 1697450431, 1697450613, 1697451754,
1697452542, 1697453562, 1697454220, 1697456651, 1697458665, 1697459235,
1697459623, 1697460103, 1697462573, 1697465688, 1697465895, 1697471918,
1697481593, 1697484185, 1697484848, 1697487593, 1697489806, 1697490800,
1697492389, 1697493518, 1697497279, 1697498388, 1697500977, 1697503294,
1697503803, 1697504282, 1697507018, 1697509698, 1697510363, 1697515540,
1697521807, 1697527684, 1697528907, 1697531377, 1697532971, 1697533654,
1697534942, 1697536942, 1697538218, 1697539113, 1697540913, 1697541816,
1697544257, 1697544497, 1697545254, 1697547609, 1697549658, 1697551369,
1697555565, 1697574982, 1697575282, 1697577449, 1697582925, 1697583167,
1697586122, 1697588947, 1697589190, 1697590025, 1697592336, 1697593392,
1697596015, 1697599137, 1697675577, 1697677173, 1697680111, 1697680655,
1697681703, 1697682820, 1697683299, 1697688884, 1697701520, 1697707337,
1697708723, 1697710012, 1697715504, 1697717958, 1697722665, 1697750243,
1697760414, 1697762478, 1697765262, 1697766386, 1697767403, 1697768488,
1697772558, 1697791313, 1697792507, 1697794548, 1697799551, 1697801282,
1697803148, 1697808225, 1697812387, 1697834783, 1697835407, 1697836014,
1697843965, 1697847805, 1697850499, 1697852074, 1697853567, 1697856249,
1697859051, 1697862067, 1697875484, 1697879210, 1697883267, 1697884428,
1697885029, 1697887032, 1697891108, 1697892971, 1697893906, 1697894351,
1697902040, 1697919432, 1697919492, 1697921226, 1697925215, 1697925395,
1697928808, 1697931759, 1697934650, 1697935634, 1697937712, 1697938498,
1697938802, 1697939858, 1697944576, 1697945783, 1697959342, 1697962952,
1697963609, 1697965285, 1697968404, 1697969347, 1697969436, 1697972520,
1698009156, 1698009911, 1698013709, 1698017378, 1698019515, 1698020990,
1698023333, 1698023970, 1698024387, 1698029493, 1698030292, 1698035270,
1698049243, 1698053552, 1698053998, 1698054264, 1698058384, 1698058775,
1698064261, 1698064558, 1698071264, 1698075316, 1698093205, 1698094382,
1698098488, 1698099058, 1698104379, 1698108963, 1698109142, 1698115852,
1698119042, 1698132518, 1698133304, 1698138537, 1698138715, 1698139070,
1698139187, 1698143855, 1698143974, 1698145048, 1698146669, 1698149824,
1698150886, 1698177208, 1698183083, 1698183388, 1698188552, 1698189329,
1698194261, 1698194567, 1698195683, 1698202729), tzone = "", class = c("POSIXct",
"POSIXt")), Latitude = c(33.6964, 33.6982, 33.6859, 33.7037,
33.6942, 33.6973, 33.6937, 33.6928, 33.7016, 33.7012, 33.7016,
33.6977, 33.6965, 33.6924, 33.6958, 33.6938, 33.6934, 33.6953,
33.6956, 33.6893, 33.6931, 33.693, 33.6933, 33.691, 33.6879,
33.6874, 33.6904, 33.6893, 33.6864, 33.6834, 33.684, 33.6804,
33.6823, 33.6825, 33.6564, 33.679, 33.6784, 33.6788, 33.6804,
33.6814, 33.6807, 33.7232, 33.6872, 33.6815, 33.6876, 33.6992,
33.6898, 33.6891, 33.6886, 33.7006, 33.6884, 33.6969, 33.699,
33.6916, 33.6891, 33.6878, 33.6862, 33.6845, 33.6831, 33.6787,
33.6821, 33.6796, 33.6715, 33.6813, 33.6748, 33.6724, 33.6707,
33.6738, 33.6701, 33.6678, 33.6651, 33.6654, 33.6587, 33.6387,
33.6474, 33.6477, 33.6459, 33.6461, 33.6489, 33.6376, 33.6498,
33.6431, 33.6437, 33.6442, 33.6438, 33.6376, 33.645, 33.6428,
33.6432, 33.6466, 33.6389, 33.6267, 33.6255, 33.627, 33.6235,
33.6236, 33.6276, 33.622, 33.6215, 33.6231, 33.6237, 33.6259,
33.6245, 33.6298, 33.6309, 33.6291, 33.6362, 33.6347, 33.6385,
33.6376, 33.6379, 33.6357, 33.6383, 33.6501, 33.6483, 33.6436,
33.6612, 33.6667, 33.6728, 33.6896, 33.6087, 33.6739, 33.6718,
33.6523, 33.6787, 33.6818, 33.7089, 33.6688, 33.6943, 33.6281,
33.6772, 33.6713, 33.6799, 33.6772, 33.679, 33.6791, 33.6798,
33.6806, 33.6785, 33.7079, 33.6799, 33.6802, 33.6718, 33.6742,
33.6627, 33.6782, 33.6822, 33.6795, 33.6795, 33.6827, 33.68,
33.6808, 33.6822, 33.6796, 33.6798, 33.6789, 33.6807, 33.6782,
33.6783, 33.6651, 33.6675, 33.6702, 33.7039, 33.5635, 33.6794,
33.6713, 33.6731, 33.6597, 33.6712, 33.6671, 33.6567, 33.6711,
33.6692, 33.6715, 33.6719, 33.6715, 33.6804, 33.6702, 33.671,
33.6688, 33.6708, 33.6696, 33.6737, 33.6395, 33.6666, 33.691,
33.6787, 33.6996, 33.6813, 33.674, 33.6736, 33.6815, 33.6808,
33.6851, 33.6852, 33.6855, 33.6834, 33.6831, 33.6798, 33.6828,
33.6816, 33.6835, 33.6799, 33.6878, 33.6805, 33.7106, 33.6802,
33.6853, 33.68, 33.6809, 33.6915, 33.6842, 33.6835, 33.6826,
33.6795, 33.6829, 33.6843, 33.6812, 33.6833, 33.6872, 33.6823,
33.6791, 33.6845, 33.6836, 33.6608, 33.6819, 33.6808, 33.6851,
33.7083, 33.6789, 33.6866, 33.6839, 33.6763, 33.6825, 33.6838,
33.6725, 33.6856, 33.683, 33.6829, 33.68, 33.677, 33.6807, 33.6779,
33.6084, 33.6807, 33.6813, 33.68, 33.6738, 33.6844, 33.6901,
33.6987), Longitude = c(-118.1885, -118.1855, -118.1986, -118.2354,
-118.1863, -118.1893, -118.183, -118.1838, -118.1771, -118.1934,
-118.1817, -118.1863, -118.1805, -118.1774, -118.1684, -118.1491,
-118.1419, -118.1282, -118.1411, -118.105, -118.1325, -118.1237,
-118.1253, -118.1269, -118.1271, -118.1269, -118.1208, -118.1264,
-118.1297, -118.1462, -118.1276, -118.1313, -118.1305, -118.1328,
-118.1248, -118.1396, -118.1417, -118.1412, -118.1373, -118.1394,
-118.145, -118.1663, -118.1413, -118.0959, -118.1469, -118.137,
-118.1338, -118.1103, -118.1093, -118.1462, -118.115, -118.1597,
-118.1042, -118.0833, -118.0673, -118.0724, -118.066, -118.0611,
-118.0537, -118.0472, -118.0553, -118.0526, -118.0672, -118.0469,
-118.0502, -118.0461, -118.0601, -118.0466, -118.0407, -118.0473,
-118.0456, -118.0463, -118.0426, -118.026, -118.0394, -118.0369,
-118.0349, -118.0289, -118.0114, -118.048, -118.0406, -118.0173,
-118.0091, -118.0123, -118.0006, -117.9942, -118.0056, -117.9967,
-117.9996, -117.9931, -117.9799, -117.9543, -117.9684, -117.968,
-117.9626, -117.9622, -117.957, -117.9525, -117.9561, -117.9552,
-117.955, -117.9689, -117.9574, -117.9581, -117.9529, -117.963,
-117.9613, -117.9633, -117.9658, -117.9655, -117.9616, -117.9618,
-117.9641, -117.9671, -117.9639, -117.9502, -117.9629, -117.9798,
-117.9541, -117.9746, -117.9808, -117.9492, -117.9664, -117.9392,
-117.9351, -118.0015, -117.9705, -117.9634, -118.0317, -117.9745,
-117.9637, -118.0065, -117.9648, -117.9739, -117.9658, -117.9681,
-117.9658, -117.9654, -117.9639, -118.0914, -117.9767, -117.9574,
-117.9947, -117.9549, -117.9837, -117.9544, -117.9682, -117.9678,
-117.9651, -117.9692, -117.9623, -117.9579, -117.9608, -117.9615,
-117.9646, -117.9664, -117.9654, -117.963, -117.9731, -117.9333,
-117.9777, -117.9426, -117.9721, -117.991, -117.9663, -117.9602,
-117.976, -117.9648, -117.9666, -117.9566, -118.0325, -117.9696,
-117.9635, -117.9639, -117.9655, -117.9672, -117.9869, -117.9712,
-117.9653, -117.9665, -117.9668, -117.9586, -117.9726, -118.0004,
-117.9389, -117.9597, -117.964, -117.9613, -117.9646, -118.0135,
-117.9576, -117.9682, -117.9751, -117.9691, -117.9666, -117.9679,
-117.9646, -117.9655, -117.9776, -117.9692, -117.9696, -117.97,
-118.0032, -117.9671, -117.9744, -117.9563, -117.9639, -117.963,
-117.9676, -117.9841, -117.9605, -117.9629, -117.9654, -117.964,
-117.9705, -117.9663, -117.9774, -117.9638, -117.9664, -117.9767,
-117.9652, -117.9449, -117.9672, -117.97, -117.958, -117.9682,
-117.9753, -117.9732, -117.9917, -117.9588, -117.9675, -117.968,
-117.9291, -117.9612, -117.9642, -117.9643, -117.9737, -117.9704,
-117.9684, -117.9695, -117.9707, -117.9577, -117.9683, -117.9262,
-117.9636, -117.9659, -117.9693, -117.9334, -117.9568, -117.9564,
-117.9321), Error_radius = c(208, 356, 3882, 1282, 480, 197,
1736, 483, 1011, 1634, 1351, 141, 773, 219, 246, 252, 3222, 218,
257, 928, 250, 456, 228, 113, 654, 873, 299, 208, 172, 1259,
183, 565, 228, 116, 1575, 92, 195, 149, 520, 836, 1596, 19910,
1155, 827, 2245, 1534, 694, 2817, 5677, 1159, 132, 1829, 698,
1516, 108, 159, 114, 164, 117, 678, 530, 92, 904, 401, 160, 120,
1305, 122, 1167, 169, 173, 149, 209, 5506, 193, 251, 170, 113,
467, 3888, 2866, 250, 133, 116, 227, 426, 168, 164, 313, 628,
467, 2761, 176, 377, 177, 373, 331, 216, 213, 118, 267, 2175,
117, 205, 224, 143, 393, 102, 147, 103, 136, 126, 151, 162, 174,
301, 184, 973, 703, 1110, 8078, 778, 12399, 1360, 1532, 2327,
2416, 610, 1240, 1626, 513, 1629, 132, 222, 347, 145, 121, 121,
499, 4609, 1590, 658, 2707, 1070, 743, 1232, 5431, 1986, 112,
383, 148, 739, 229, 814, 118, 122, 132, 245, 291, 1507, 882,
982, 893, 10190, 635, 164, 1460, 635, 135, 413, 2164, 260, 508,
175, 319, 128, 868, 486, 230, 178, 424, 323, 202, 479, 2639,
3308, 7210, 1501, 1965, 9107, 1644, 209, 688, 226, 582, 479,
136, 152, 1192, 120, 142, 468, 755, 793, 1877, 800, 326, 419,
512, 430, 1241, 120, 157, 138, 357, 201, 460, 1002, 304, 836,
287, 2834, 120, 236, 907, 164, 143, 244, 505, 303, 3326, 757,
1829, 222, 165, 8710, 550, 188, 227, 136, 493, 333, 459, 169,
246, 630, 359, 1728, 899, 276, 406)), row.names = c(NA, -251L
), class = c("tbl_df", "tbl", "data.frame"))
Any help would be greatly appreciated