PART A: Netlogo model Model output for pre-set parameters •
grass-regrowth-time = 30, initial-number-sheep = 100,
sheep-gain-from-food = 4, sheep-reproduce = 4%, initial-number-wolves =
50, wolves-gain-from-food = 20, wolves-reproduce = 5%
The outputs from both
model version (Fig 1.1, Fig1.2), present two possible outcome of
interaction amongst species population with a community. The sheep-wolve
model a two-level community interaction with no consideration for
producers. In this model the sheep do not need to eat to survive but the
wolves must hunt for the sheep to survive, the curve shows a time where
the model stops with large number of sheep and no wolves in the
community. In contrast, the sheep-wolves-grass model output, include the
producers in the system, so that a three tropic level is created, the
survival of the sheep now depends on the growth of grasses and the
wolves keeps the growth rate of the sheep in check which in turns allow
for the grass to grow sustainably in the system. An equilibrium
populations state is reach so that no member of the community goes
extinct.
Model output for adjusted parameters • grass-regrowth-time = 10,
initial-number-sheep = 60, sheep-gain-from-food = 10, sheep-reproduce =
7%, initial-number-wolves = 90, wolves-gain-from-food = 10,
wolves-reproduce = 6%
In Fig 2.1, we observed
that even at a reduce value in gain from food and reproduction rate of
the wolves, although at higher initial population, the wolves did not
become extinct. Whereas the new set of parameters it took a little more
time for the system to attain a stable population in the
sheep-wolves-grass model (Fig2.2) PART B: ANALYSING DATA FROM NETLOGO IN
R Data
getwd()
## [1] "C:/Users/hp/OneDrive/Desktop/Winter 2021/MOD3"
setwd("C:/Users/hp/OneDrive/Desktop/Winter 2021/MOD3")
ws <- read.csv("Wolf Sheep Predation wolves-sheep behaviour-table.csv", skip = 6, header = T,
stringsAsFactors = FALSE)
head(ws)
str(ws)
## 'data.frame': 510188 obs. of 13 variables:
## $ X.run.number. : int 2 1 2 1 1 2 1 1 2 2 ...
## $ wolf.gain.from.food : int 25 25 25 25 25 25 25 25 25 25 ...
## $ show.energy. : chr "false" "false" "false" "false" ...
## $ wolf.reproduce : int 7 7 7 7 7 7 7 7 7 7 ...
## $ initial.number.wolves: int 30 30 30 30 30 30 30 30 30 30 ...
## $ initial.number.sheep : int 50 50 50 50 50 50 50 50 50 50 ...
## $ model.version : chr "sheep-wolves" "sheep-wolves" "sheep-wolves" "sheep-wolves" ...
## $ sheep.gain.from.food : int 6 6 6 6 6 6 6 6 6 6 ...
## $ grass.regrowth.time : int 25 25 25 25 25 25 25 25 25 25 ...
## $ sheep.reproduce : int 2 2 2 2 2 2 2 2 2 2 ...
## $ X.step. : int 0 0 1 1 2 2 3 4 3 4 ...
## $ count.wolves : int 30 30 32 31 34 34 36 43 36 35 ...
## $ count.sheep : int 50 50 50 51 51 53 51 51 53 53 ...
names(ws)
## [1] "X.run.number." "wolf.gain.from.food" "show.energy."
## [4] "wolf.reproduce" "initial.number.wolves" "initial.number.sheep"
## [7] "model.version" "sheep.gain.from.food" "grass.regrowth.time"
## [10] "sheep.reproduce" "X.step." "count.wolves"
## [13] "count.sheep"
num_of_run <- max(ws$X.run.number.)
time <- max(ws$X.step.)
plot for population dynamics
i <- which(ws$X.run.number. == 1)
plot(x = ws$X.step.[i], y = ws$count.sheep[i], type = "l", lwd = 2, las = 1,
ylim = c(0,10000), xlab = "time", ylab = "population size", #max(ws$count.sheep)
col = ifelse(unique(ws$model.version[i]) == "sheep-wolves", "grey", "blue"))
for(j in 2:num_of_run){
i <- which(ws$X.run.number. == j)
lines(x = ws$X.step.[i], y = ws$count.sheep[i], col = ifelse(unique(ws$model.version[i]) == "sheep-wolves", "grey", "blue"),lwd = 2)
}
for(j in 1:num_of_run){
i <- which(ws$X.run.number. == j)
lines(x = ws$X.step.[i], y = ws$count.wolves[i], col = ifelse(unique(ws$model.version[i]) == "sheep-wolves", "red", "green"), lwd = 2)
}
legend("topleft", col = c("grey", "blue", "red", "green"), lwd = 2, legend = c("sheep without grass", "sheep with grass", "wolves without grass", "wolves with grass"), bty = "n")
number of extinctions
# rownumbers of end of runs
(i <- which(ws$X.step. == time))
## [1] 380 543 743 929 1153 1325 1592 1731 1991 2021
## [11] 2775 3246 3841 4070 4286 4505 4686 4938 5014 5353
## [21] 5367 5750 5863 6035 6370 6692 6841 7089 7405 7702
## [31] 7810 8098 8517 8695 8895 9080 9297 9493 9589 9941
## [41] 9954 10407 10826 11050 11223 11464 11628 11829 12061 12302
## [51] 12718 12822 13113 13260 13513 13668 13906 14012 14625 14866
## [61] 15116 15124 15641 15787 16030 16260 16492 16577 16886 17013
## [71] 17268 17441 17674 17844 18014 18218 18403 18637 18800 19050
## [81] 19191 19483 19572 19924 19950 20322 20368 20708 20800 21115
## [91] 21192 21503 21629 21888 22019 22271 22421 22657 22878 23011
## [101] 23345 23361 23737 23780 24145 24188 24536 24649 24895 25141
## [111] 25196 25538 25646 25960 25981 26389 26659 26798 27212 27632
## [121] 27767 28115 28473 28507 28879 28904 29278 29314 29685 29706
## [131] 30032 30163 30405 30592 30802 31002 31172 31444 31553 31874
## [141] 31972 32212 32382 32613 32774 33031 33161 33417 33589 33824
## [151] 33953 35675 36019 36253 36424 36638 36853 37019 37259 37411
## [161] 37615 39662 39668 40069 40070 40448 40503 40843 40890 41263
## [171] 41279 42597 43372 43455 43704 43927 44096 44356 44471 44780
## [181] 44839 45100 45979 47127 47229 47503 47684 47899 48081 48269
## [191] 48531 48643 48939 49046 49381 49423 49794 49815 50168 50204
## [201] 50588 50636 50978 51041 51335 51492 51706 51939 52073 52370
## [211] 52450 52796 52832 53199 53238 53583 53645 53964 54090 54342
## [221] 54531 54702 55000 55043 55399 55449 55794 55859 56169 56290
## [231] 56534 56768 56870 57235 57515 57664 58066 58246 58502 58613
## [241] 58947 59311 59377 59689 59818 60070 60253 60426 60676 60795
## [251] 61135 61173 61548 61569 61930 61996 62313 62414 62706 62948
## [261] 63077 63276 63557 63586 63938 64052 64350 64496 64721 64840
## [271] 65085 65853 66005 66252 66614 66929 67269 67419 67637 67880
## [281] 67993 68282 68414 68676 68765 69011 69372 69809 69893 70185
## [291] 70390 70537 70787 71034 71098 71430 71657 71785 72022 72218
## [301] 72447 72586 72778 72977 73711 74174 74331 74531 74763 74969
## [311] 75185 75387 75548 75768 75996 76204 76354 76636 76685 77343
## [321] 77734 78127 78311 78505 78879 79173 79343 79533 79772 79902
## [331] 80220 80222 80608 80655 80947 81098 81327 81510 81716 81942
## [341] 82102 82369 82480 82784 82875 83206 83284 83599 83713 83966
## [351] 84165 84306 84629 84662 85030 85070 85396 85515 85771 85951
## [361] 86140 86395 86513 86853 86856 87234 87336 87628 87741 87977
## [371] 88227 88353 88623 88724 88993 89120 89393 89534 89816 89895
## [381] 90239 90303 90599 90758 91013 91189 91410 91594 91809 92009
## [391] 92205 92433 92571 92813 92953 93236 93331 93680 93695 94068
## [401] 94129 94435 94564 94811 95074 95139 95450 95532 95874 95932
## [411] 96296 96305 96686 96721 97103 97118 97484 97668 97812 98098
## [421] 98146 98504 98552 98897 98955 99290 99345 99715 99721 100101
## [431] 100138 100472 100604 100757 101010 101167 101515 101610 102060 102139
## [441] 102473 102521 102799 103204 103303 103583 103701 103960 104125 104325
## [451] 104546 104693 104903 105249 105256 105617 105701 106022 106246 106277
## [461] 106604 106852 106904 107203 107347 107547 107732 107965 108176 108328
## [471] 108569 108752 108986 109104 109408 109537 109875 110097 110396 110499
## [481] 110724 110916 111173 111329 111590 111671 112019 112090 112398 112471
## [491] 112763 112898 113207 113282 113614 113670 114040 114050 114424 114482
## [501] 114835 114868 115244 115260 115640 115669 116028 116082 116405 116525
## [511] 116769 116966 117139 117399 117514 117836 117884 118262 118266 118648
## [521] 118687 119010 119143 119388 119593 119741 120019 120146 120395 120547
## [531] 120753 120982 121183 121378 121588 121806 121960 122160 122443 122562
## [541] 122887 122888 123283 123296 123691 123692 124070 124125 124451 124554
## [551] 124796 125016 125172 125428 125569 125859 125945 126271 126341 126704
## [561] 126707 127105 127120 127477 127656 127838 128101 128221 128458 128672
## [571] 128778 129078 129232 129479 129641 129881 130081 130212 130459 130647
## [581] 130851 131055 131258 131461 131663 131866 132068 132270 132472 132674
## [591] 132931 133133 133334 133535 133737 133938 134140 134342 134543 134744
## [601] 134945 135147 135348 135549 135750 135951 136152 136353 136554 136755
## [611] 136956 137158 137359 137560 137761 137849 138076 138328 138500 138740
## [621] 138930 139086 139283 139502 139699 139932 140122 140367 140445 140729
## [631] 140843 141134 141292 141562 141699 141976 142047 142329 142563 142676
## [641] 142905 143137 143375 143573 143628 143985 144007 144377 144457 144742
## [651] 144880 145082 145324 145466 145743 145848 146166 146248 146520 146696
## [661] 146938 147132 147305 147558 147645 147948 148130 148321 148563 148656
## [671] 148986 149055 149410 149435 149787 149875 150141 150323 150519 150772
## [681] 150905 151220 151247 151622 151657 152007 152104 152383 152574 152769
## [691] 152921 153127 153357 153516 153781 153903 154200 154281 154633 154656
## [701] 154993 155129 155437 155469 155838 155893 156203 156362 156585 156788
## [711] 156931 157193 157317 157624 157700 158057 158069 158417 158514 158795
## [721] 159043 159155 159373 159609 159726 160011 160119 160467 160477 160859
## [731] 160880 161215 161417 161678 161685 162033 162162 162407 162622 162746
## [741] 162975 163210 163475 163501 163820 163978 164190 164394 164586 164802
## [751] 164936 165254 165354 165649 165800 166033 166240 166386 166657 166777
## [761] 167019 167262 167364 167683 167722 168091 168113 168470 168555 168829
## [771] 168960 169262 169388 169642 169881 169952 170317 170348 170710 170811
## [781] 171048 171272 171447 171644 171822 172021 172230 172428 172619 172870
## [791] 172970 173257 173488 173607 173859 174127 174221 174475 174641 174831
## [801] 175075 175304 175536 175594 175869 176038 176250 176455 176638 176884
## [811] 176995 177347 177359 177707 177793 178126 178190 178487 178615 178875
## [821] 179079 179247 179524 179608 179965 179979 180357 180391 180706 180850
## [831] 181069 181299 181439 181741 181810 182180 182185 182551 182619 182917
## [841] 183076 183266 183533 183632 183981 183999 184327 184462 184715 184905
## [851] 185037 185331 185428 185713 185837 186197 186204 186533 186648 186907
## [861] 187136 187247 187589 187626 187991 188031 188362 188459 188740 188891
## [871] 189094 189350 189468 189806 189835 190173 190266 190539 190702 190920
## [881] 191158 191417 191506 191817 191897 192223 192281 192620 192697 193003
## [891] 193101 193430 193439 193793 193939 194242 194243 194607 194746 195037
## [901] 195083 195420 195591 195774 196031 196119 196434 196529 196848 196901
## [911] 197142 197417 197620 197748 197989 198185 198463 198464 198798 199030
## [921] 199253 199329 199638 199781 200014 200245 200363 200651 200750 201051
## [931] 201134 201457 201566 201777 202061 202151 202397 202626 202820 202991
## [941] 203214 203446 203671 203856 204065 204163 204469 204546 204884 204976
## [951] 205171 205447 205560 205883 205946 206279 206391 206591 206879 206968
## [961] 207277 207346 207695 207751 208070 208219 208468 208627 208846 209075
## [971] 209165 209514 209522 209885 209954 210255 210395 210635 210831 211014
## [981] 211326 211328 211722 211737 212119 212169 212504 212591 212906 212998
## [991] 213241 213462 213614 213921 213966 214335 214352 214709 214794 215073
## [1001] 215276 215482 215697 215845 216120 216216 216546 216571 216947 216991
## [1011] 217252 217453 217652 217835 218096 218232 218491 218633 218883 219050
## [1021] 219314 219496 219665 219940 220023 220363 220390 220764 220787 221134
## [1031] 221248 221495 221667 221879 222097 222252 222531 222632 222975 223002
## [1041] 223258 223511 223764 223864 224129 224226 224532 224644 224943 225050
## [1051] 225269 225484 225691 225899 226067 226468 226680 226894 227046 227301
## [1061] 227490 227691 227930 228055 228301 228486 228695 228884 229108 229245
## [1071] 229551 229624 229921 230071 230307 230470 230868 231176 231202 231593
## [1081] 231623 231998 232005 232368 232445 232740 232909 233098 233260 233499
## [1091] 233703 233857 234193 234223 234562 234640 234947 235054 235304 235549
## [1101] 235700 235960 236072 236366 236460 236797 236847 237221 237238 237555
## [1111] 237655 238139 238275 238628 238631 238959 239074 239581 239677 240027
## [1121] 240039 240415 240461 240780 240915 241130 241314 241522 241757 241889
## [1131] 242219 242260 242640 242658 243012 243095 243443 243460 243769 243947
## [1141] 244140 244391 244509 244835 244863 245218 245308 245585 245759 245950
## [1151] 246198 246321 246644 246683 247048 247093 247438 247501 247827 247927
## [1161] 248223 248340 248576 248806 248938 249247 249301 249638 249720 250010
## [1171] 250111 250394 250532 250783 250963 251162 251454 251520 251876 251900
## [1181] 252266 252334 252642 252770 253016 253189 253372 253648 253742 254088
## [1191] 254116 254490 254527 254851 254971 255229 255498 255529 255891 256020
## [1201] 256296 256363 256699 256753 257114 257134 257422 257617 257995 258589
## [1211] 258971 259370 259789 260055 260072 260454 260494 260833 260890 261227
## [1221] 261327 261594 262028 262721 262907 263099 263325 263639 263999 264021
## [1231] 264387 264518 264771 264895 265201 265251 266446 266696 266825 267276
## [1241] 267509 267644 267910 268074 268321 268450 268756 268759 269144 269196
## [1251] 269646 270238 270427 271420 271465 271789 271912 272167 272361 272554
## [1261] 272800 272915 273159 273285 273654 273986 274048 274302 274528 274683
## [1271] 274937 275143 275355 275522 275790 275870 276220 276239 276599 276682
## [1281] 276985 277091 277348 277534 277722 277978 278082 278427 278459 278792
## [1291] 278894 279202 279356 279562 279786 279971 280218 280283 280642 280676
## [1301] 281031 281079 281362 281545 281752 281944 282122 282370 282808 283233
## [1311] 283264 283633 283667 284016 284120 284403 284554 284761 285000 285107
## [1321] 285442 285476 285849 285866 286189 286323 286571 286742 286959 287209
## [1331] 287447 287476 287775 287927 288165 288339 288573 288722 288960 289110
## [1341] 289691 291223 291308 291564 291721 291980 292133 292376 292531 292788
## [1351] 292905 293334 294701 294921 295243 295513 295631 295960 296016 296371
## [1361] 296412 296658 298006 298615 298788 299005 299209 299385 299600 299868
## [1371] 299971 300238 300366 300749 302411 302542 302769 302994 303134 303415
## [1381] 303526 303853 303906 304218 304315 304679 304705 305085 305102 305457
## [1391] 305526 305806 306222 306284 306607 306675 307046 307050 307419 307488
## [1401] 307785 307926 308123 308414 308496 308812 308898 309232 309286 309655
## [1411] 309670 310034 310071 310458 310473 310805 310920 311159 311366 311517
## [1421] 311810 311928 312162 312320 312645 312697 313071 313364 313810 314195
## [1431] 314409 314582 314792 315015 315172 315473 315550 315901 315916 316282
## [1441] 316355 316662 316790 317009 317220 317381 317665 317778 318011 318274
## [1451] 318519 318590 318892 319062 319254 319514 319557 319912 319996 320389
## [1461] 320640 321005 321186 321403 321596 321824 322104 322124 322504 322534
## [1471] 322900 323038 323228 323506 323553 323920 323924 324278 324632 324988
## [1481] 325146 325761 326159 326358 326616 326660 326989 327180 327325 327607
## [1491] 327699 327927 328122 328338 328518 328823 328847 329172 329302 329708
## [1501] 329938 330343 330571 330648 330993 331020 331387 331440 331793 331826
## [1511] 332133 332514 332681 333214 333568 333581 334014 334355 334371 334763
## [1521] 334764 335150 335210 335520 335691 335845 336084 336500 336618 336949
## [1531] 336998 337366 337404 337707 337846 338111 338315 338464 338735 338849
## [1541] 339176 339193 339575 339611 339922 340057 340307 340484 340689 340927
## [1551] 341057 341363 341431 341779 341813 342197 342203 342599 342606 342982
## [1561] 343055 343375 343465 343796 343826 344142 344252 344524 344690 345115
## [1571] 345262 345545 345929 346276 346596 346620 346995 347038 347363 347527
## [1581] 347712 347925 348085 348372 348457 348800 348837 349207 349246 349566
## [1591] 349684 349930 350201 350275 350565 350686 350939 351138 351271 351575
## [1601] 351672 351886 352230 352235 352628 352660 353022 353111 353311 353515
## [1611] 353877 354171 354359 354408 354783 354800 355195 355197 355596 355599
## [1621] 355852 356171 356525 356566 356907 357098 357186 357421 357597 357940
## [1631] 358054 358233 358405 358702 358789 359119 359184 359535 359579 359835
## [1641] 360016 360364 360378 360736 361058 361425 361689 361994 362206 362403
## [1651] 362418 362803 362817 363193 363238 363514 363663 363969 364350 364378
## [1661] 364720 364807 365268 365356 365628 365758 366088 366132 366502 366518
## [1671] 366908 366917 367293 367343 367585 367887 367957 368313 368342 368693
## [1681] 368774 369078 369184 369473 369640 369794 370064 370185 370508 370554
## [1691] 370922 370944 371331 371341 371656 371834 372017 372285 372394 372722
## [1701] 372763 373142 373147 373516 373596 373868 374035 374239 374465 374611
## [1711] 374925 374979 375329 375378 375711 375795 376118 376226 376541 376594
## [1721] 376961 376970 377345 377403 377751 377791 378158 378181 378565 378577
## [1731] 378955 378997 379344 379410 379669 379905 380042 380358 380405 380781
## [1741] 380784 381150 381228 381544 381778 381821 382156 382319 382556 382704
## [1751] 382948 383147 383321 383533 383656 383978 384146 384299 384598 384664
## [1761] 384927 385201 385285 385568 385777 385992 386204 386327 386537 386769
## [1771] 386915 387193 387272 387582 387663 387993 388136 388336 388559 388738
## [1781] 388990 389156 389390 389505 389718 389931 390140 390349 390558 390772
## [1791] 390989 391204 391419 391626 391744 391956 392213 392323 392639 392709
## [1801] 393013 393190 393343 393625 393841 394027 394147 394449 394451 394829
## [1811] 394926 395235 395349 395598 395730 395979 396248 396344 396627 396772
## [1821] 397020 397215 397378 397635 397746 398056 398096 398453 398512 398838
## [1831] 398955 399235 399359 399638 399742 399991 400179 400357 400618 400727
## [1841] 401063 401112 401466 401504 401839 401954 402267 402313 402686 402717
## [1851] 403080 403121 403453 403563 403793 404030 404163 404481 404522 404902
## [1861] 404903 405301 405310 405690 405732 406081 406207 406443 406646 406833
## [1871] 407066 407195 407470 407636 407795 408022 408211 408416 408631 408803
## [1881] 409028 409212 409460 409577 409861 410051 410217 410520 410540 410926
## [1891] 410949 411304 411411 411669 411820 412046 412253 412414 412684 412788
## [1901] 413138 413145 413509 413583 413839 414095 414256 414436 414627 414856
## [1911] 415059 415224 415434 415650 415787 416106 416251 416560 416561 416895
## [1921] 417100 417245 417504 417711 417933 418099 418206 418486 418612 418898
## [1931] 419011 419319 419375 419706 419815 420160 420212 420532 420654 420904
## [1941] 421166 421258 421530 421771 421796 422151 422195 422533 422642 422922
## [1951] 423035 423300 423475 423689 423844 424134 424332 424473 424743 424956
## [1961] 425037 425359 425478 425743 425954 426163 426373 426580 426785 426989
## [1971] 427194 427401 427606 427812 427876 428139 428303 428607 428655 428974
## [1981] 429087 429378 429544 429690 429959 430116 430313 430534 430697 430975
## [1991] 431068 431393 431461 431807 431856 432224 432253 432580 432681 432947
## [2001] 433106 433328 433534 433714 434024 434069 434423 434487 434791 434918
## [2011] 435155 435347 435541 435766 435910 436204 436299 436646 436675 437041
## [2021] 437094 437402 437546 437761 438003 438108 438457 438478 438793 438959
## [2031] 439147 439417 439507 439859 439886 440221 440316 440590 440742 440962
## [2041] 441164 441343 441611 441720 442006 442162 442364 442654 442712 443086
## [2051] 443099 443448 443529 443846 443933 444221 444366 444593 444794 444965
## [2061] 445246 445340 445698 445716 445956 446236 446509 446510 446901 446943
## [2071] 447212 447505 447554 447881 447974 448251 448465 448573 448881 448980
## [2081] 449265 449446 449674 449847 450095 450233 450487 450612 450869 451063
## [2091] 451210 451463 451645 451935 451939 452276 452491 452607 452880 453069
## [2101] 453230 453485 453653 453841 454075 454309 454430 454696 454868 455092
## [2111] 455256 455517 455672 455938 455993 456312 456409 456685 456874 457068
## [2121] 457263 457527 457655 457932 458144 458214 458531 458682 458931 459031
## [2131] 459361 459398 459733 459912 460033 460340 460428 460708 460911 461166
## [2141] 461190 461573 461629 461921 462135 462281 462589 462590 462965 463063
## [2151] 463344 463500 463691 463968 464030 464396 464399 464749 464846 465126
## [2161] 465285 465506 465701 465898 466204 466209 466583 466660 466978 467084
## [2171] 467359 467507 467740 467944 468082 468367 468467 468797 468839 469213
## [2181] 469238 469590 469667 469959 470161 470356 470544 470743 470990 471094
## [2191] 471399 471520 471789 471924 472138 472306 472576 472696 472989 473084
## [2201] 473413 473461 473793 473895 474208 474279 474645 474658 475027 475115
## [2211] 475399 475564 475813 475914 476168 476362 476538 476796 476910 477246
## [2221] 477276 477633 477711 478001 478256 478297 478554 478749 478938 479168
## [2231] 479338 479634 479693 480056 480084 480494 480776 480916 481181 481576
## [2241] 481708 482033 482061 482457 482461 482816 482892 483210 483303 483595
## [2251] 483710 483959 484108 484389 484512 484831 484883 485223 485292 485595
## [2261] 485706 485999 486146 486383 486550 486749 487023 487119 487424 487540
## [2271] 487824 487901 488154 488579 489050 489098 489467 489491 489836 489907
## [2281] 490163 490421 490519 490854 490914 491260 491329 491614 491784 491956
## [2291] 492155 492412 492546 492790 492969 493194 493380 493767 494003 494161
## [2301] 494424 494609 494780 495046 495144 495480 495527 495844 495984 496188
## [2311] 496419 496586 496846 496963 497316 497333 497713 497741 498052 498183
## [2321] 498434 498643 498758 499128 499138 499498 499575 499858 500000 500212
## [2331] 500484 500581 500911 500968 501328 501358 501730 501770 502098 502203
## [2341] 502447 502645 502829 503088 503211 503527 503567 503941 503979 504256
## [2351] 504414 504680 504788 505148 505183 505496 505588 505858 506024 506319
## [2361] 506427 506695 506863 507040 507285 507428 507756 507794 508176 508179
## [2371] 508540 508619 508950 509022 509306 509469 509677 509899 510043 510188
ws1 <- ws[i, c("model.version","count.sheep", "count.wolves")]
par(mfrow = c(2,1), mar = c(3,4,2,1))
ms <- tapply(ws1$count.sheep, ws1$model.version, median)
mw <- tapply(ws1$count.wolves, ws1$model.version, median)
boxplot(ws1$count.sheep ~ ws1$model.version, las = 1, main = "sheep", ylab = "abundance at t = 300")
text(x = 1, y = 5500, ms[1], col = "grey50", font = 2)
text(x = 2, y = 5500, ms[2], col = "black", font = 2)
boxplot(ws1$count.wolves ~ ws1$model.version, las = 1, main = "wolves", ylab = "abundance at t = 300", ylim = c(0,120))
text(x = 1, y = 110, mw[1], col = "orange", font = 2)
text(x = 2, y = 110, mw[2], col = "darkred", font = 2)
Easy counting.
library(data.table)
setDT(ws1)
# number of extinction of at least one species
ws1[, sum(count.sheep == 0 | count.wolves == 0), by = model.version]
476 extinction in sheep-wolves version and 172 extinction in sheep-wolves-grass version