The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
This vignette demonstrates a complete and simple hatchR workflow. We will use data installed with the package from Woody Island in Lake Iliamna, Alaska (Sparks et al. 2019), to predict the hatch and emergence timing of sockeye salmon (Oncorhynchus nerka).
If you have not already done so, see the vignettes on data checks and model parameterization.
First, we load needed packages:
First, let’s check the data to make sure it’s in the right format.
We’ll print the first few rows and summary()
to get a sense
of the data:
woody_island
#> date temp_c
#> 1 1990-08-11 25.85000000
#> 2 1990-08-12 23.30833333
#> 3 1990-08-13 18.53333333
#> 4 1990-08-14 15.35000000
#> 5 1990-08-15 13.96666667
#> 6 1990-08-16 11.35833333
#> 7 1990-08-17 9.19166667
#> 8 1990-08-18 9.84166667
#> 9 1990-08-19 10.55000000
#> 10 1990-08-20 10.68333333
#> 11 1990-08-21 11.45000000
#> 12 1990-08-22 11.69166667
#> 13 1990-08-23 11.17500000
#> 14 1990-08-24 11.69166667
#> 15 1990-08-25 11.99166667
#> 16 1990-08-26 11.88333333
#> 17 1990-08-27 12.25000000
#> 18 1990-08-28 12.17500000
#> 19 1990-08-29 12.07500000
#> 20 1990-08-30 12.08333333
#> 21 1990-08-31 12.14166667
#> 22 1990-09-01 12.20000000
#> 23 1990-09-02 11.77500000
#> 24 1990-09-03 11.23333333
#> 25 1990-09-04 11.35000000
#> 26 1990-09-05 11.35000000
#> 27 1990-09-06 11.37500000
#> 28 1990-09-07 11.40000000
#> 29 1990-09-08 11.17500000
#> 30 1990-09-09 10.72500000
#> 31 1990-09-10 10.84166667
#> 32 1990-09-11 10.90000000
#> 33 1990-09-12 10.04166667
#> 34 1990-09-13 10.20000000
#> 35 1990-09-14 10.21666667
#> 36 1990-09-15 10.46666667
#> 37 1990-09-16 9.24166667
#> 38 1990-09-17 8.39166667
#> 39 1990-09-18 8.65833333
#> 40 1990-09-19 9.10833333
#> 41 1990-09-20 9.09166667
#> 42 1990-09-21 9.00000000
#> 43 1990-09-22 9.21666667
#> 44 1990-09-23 9.19166667
#> 45 1990-09-24 9.00833333
#> 46 1990-09-25 8.84166667
#> 47 1990-09-26 8.70000000
#> 48 1990-09-27 8.24166667
#> 49 1990-09-28 8.30833333
#> 50 1990-09-29 8.39166667
#> 51 1990-09-30 8.32500000
#> 52 1990-10-01 7.67500000
#> 53 1990-10-02 7.29166667
#> 54 1990-10-03 7.35000000
#> 55 1990-10-04 7.80000000
#> 56 1990-10-05 8.13333333
#> 57 1990-10-06 8.26666667
#> 58 1990-10-07 8.13333333
#> 59 1990-10-08 7.61666667
#> 60 1990-10-09 7.43333333
#> 61 1990-10-10 7.75000000
#> 62 1990-10-11 7.55000000
#> 63 1990-10-12 6.90833333
#> 64 1990-10-13 6.69166667
#> 65 1990-10-14 6.47500000
#> 66 1990-10-15 6.07500000
#> 67 1990-10-16 5.87500000
#> 68 1990-10-17 6.33333333
#> 69 1990-10-18 6.45000000
#> 70 1990-10-19 6.67500000
#> 71 1990-10-20 6.80000000
#> 72 1990-10-21 6.29166667
#> 73 1990-10-22 6.62500000
#> 74 1990-10-23 6.58333333
#> 75 1990-10-24 6.45000000
#> 76 1990-10-25 6.12500000
#> 77 1990-10-26 5.99166667
#> 78 1990-10-27 5.20000000
#> 79 1990-10-28 4.31666667
#> 80 1990-10-29 4.22500000
#> 81 1990-10-30 4.24166667
#> 82 1990-10-31 4.68333333
#> 83 1990-11-01 5.15833333
#> 84 1990-11-02 5.01666667
#> 85 1990-11-03 4.60833333
#> 86 1990-11-04 3.95833333
#> 87 1990-11-05 4.46666667
#> 88 1990-11-06 4.62500000
#> 89 1990-11-07 3.77500000
#> 90 1990-11-08 2.49166667
#> 91 1990-11-09 2.54166667
#> 92 1990-11-10 2.54166667
#> 93 1990-11-11 3.21666667
#> 94 1990-11-12 3.14166667
#> 95 1990-11-13 3.09166667
#> 96 1990-11-14 2.70000000
#> 97 1990-11-15 2.94166667
#> 98 1990-11-16 2.36666667
#> 99 1990-11-17 2.57500000
#> 100 1990-11-18 2.59166667
#> 101 1990-11-19 2.54166667
#> 102 1990-11-20 2.50000000
#> 103 1990-11-21 3.03333333
#> 104 1990-11-22 2.70000000
#> 105 1990-11-23 2.28333333
#> 106 1990-11-24 2.16666667
#> 107 1990-11-25 1.77500000
#> 108 1990-11-26 1.46666667
#> 109 1990-11-27 1.61666667
#> 110 1990-11-28 0.47500000
#> 111 1990-11-29 0.52500000
#> 112 1990-11-30 0.35833333
#> 113 1990-12-01 0.71666667
#> 114 1990-12-02 0.49166667
#> 115 1990-12-03 1.04166667
#> 116 1990-12-04 1.11666667
#> 117 1990-12-05 1.02500000
#> 118 1990-12-06 1.38333333
#> 119 1990-12-07 1.55833333
#> 120 1990-12-08 0.82500000
#> 121 1990-12-09 0.20833333
#> 122 1990-12-10 0.40000000
#> 123 1990-12-11 0.78333333
#> 124 1990-12-12 0.79166667
#> 125 1990-12-13 0.34166667
#> 126 1990-12-14 0.09166667
#> 127 1990-12-15 0.25833333
#> 128 1990-12-16 0.39166667
#> 129 1990-12-17 0.02500000
#> 130 1990-12-18 0.25000000
#> 131 1990-12-19 0.61666667
#> 132 1990-12-20 0.85833333
#> 133 1990-12-21 0.80000000
#> 134 1990-12-22 1.02500000
#> 135 1990-12-23 1.06666667
#> 136 1990-12-24 1.22500000
#> 137 1990-12-25 1.31666667
#> 138 1990-12-26 1.00833333
#> 139 1990-12-27 0.67500000
#> 140 1990-12-28 1.01666667
#> 141 1990-12-29 0.84166667
#> 142 1990-12-30 0.39166667
#> 143 1990-12-31 0.48333333
#> 144 1991-01-01 0.70000000
#> 145 1991-01-02 0.95000000
#> 146 1991-01-03 0.73333333
#> 147 1991-01-04 0.78333333
#> 148 1991-01-05 0.73333333
#> 149 1991-01-06 0.72500000
#> 150 1991-01-07 0.95000000
#> 151 1991-01-08 0.94166667
#> 152 1991-01-09 0.96666667
#> 153 1991-01-10 0.95833333
#> 154 1991-01-11 0.98333333
#> 155 1991-01-12 0.98333333
#> 156 1991-01-13 1.04166667
#> 157 1991-01-14 1.04166667
#> 158 1991-01-15 1.03333333
#> 159 1991-01-16 1.01666667
#> 160 1991-01-17 1.03333333
#> 161 1991-01-18 1.00000000
#> 162 1991-01-19 0.89166667
#> 163 1991-01-20 0.85833333
#> 164 1991-01-21 0.80833333
#> 165 1991-01-22 0.82500000
#> 166 1991-01-23 0.85833333
#> 167 1991-01-24 0.89166667
#> 168 1991-01-25 0.91666667
#> 169 1991-01-26 0.89166667
#> 170 1991-01-27 0.95000000
#> 171 1991-01-28 0.99166667
#> 172 1991-01-29 1.00000000
#> 173 1991-01-30 1.00833333
#> 174 1991-01-31 1.03333333
#> 175 1991-02-01 1.05833333
#> 176 1991-02-02 1.10000000
#> 177 1991-02-03 1.07500000
#> 178 1991-02-04 1.09166667
#> 179 1991-02-05 1.10000000
#> 180 1991-02-06 1.09166667
#> 181 1991-02-07 1.10000000
#> 182 1991-02-08 1.11666667
#> 183 1991-02-09 1.10000000
#> 184 1991-02-10 1.12500000
#> 185 1991-02-11 1.15833333
#> 186 1991-02-12 1.29166667
#> 187 1991-02-13 1.37500000
#> 188 1991-02-14 1.37500000
#> 189 1991-02-15 1.47500000
#> 190 1991-02-16 1.44166667
#> 191 1991-02-17 1.49166667
#> 192 1991-02-18 1.58333333
#> 193 1991-02-19 1.56666667
#> 194 1991-02-20 1.60000000
#> 195 1991-02-21 1.59166667
#> 196 1991-02-22 1.58333333
#> 197 1991-02-23 1.58333333
#> 198 1991-02-24 1.53333333
#> 199 1991-02-25 1.45833333
#> 200 1991-02-26 1.53333333
#> 201 1991-02-27 1.72500000
#> 202 1991-02-28 1.85000000
#> 203 1991-03-01 2.02500000
#> 204 1991-03-02 2.14166667
#> 205 1991-03-03 2.16666667
#> 206 1991-03-04 2.15000000
#> 207 1991-03-05 2.15833333
#> 208 1991-03-06 2.14166667
#> 209 1991-03-07 2.00000000
#> 210 1991-03-08 2.02500000
#> 211 1991-03-09 1.98333333
#> 212 1991-03-10 2.01666667
#> 213 1991-03-11 2.04166667
#> 214 1991-03-12 2.02500000
#> 215 1991-03-13 2.07500000
#> 216 1991-03-14 2.00000000
#> 217 1991-03-15 2.02500000
#> 218 1991-03-16 1.94166667
#> 219 1991-03-17 1.94166667
#> 220 1991-03-18 1.92500000
#> 221 1991-03-19 1.98333333
#> 222 1991-03-20 2.05000000
#> 223 1991-03-21 2.10000000
#> 224 1991-03-22 2.15000000
#> 225 1991-03-23 2.15833333
#> 226 1991-03-24 2.30000000
#> 227 1991-03-25 2.35833333
#> 228 1991-03-26 2.45000000
#> 229 1991-03-27 2.60833333
#> 230 1991-03-28 2.52500000
#> 231 1991-03-29 2.57500000
#> 232 1991-03-30 2.54166667
#> 233 1991-03-31 2.60833333
#> 234 1991-04-01 2.59166667
#> 235 1991-04-02 2.70000000
#> 236 1991-04-03 2.83333333
#> 237 1991-04-04 3.10000000
#> 238 1991-04-05 3.28333333
#> 239 1991-04-06 3.32500000
#> 240 1991-04-07 3.40000000
#> 241 1991-04-08 3.45000000
#> 242 1991-04-09 3.45833333
#> 243 1991-04-10 3.60000000
#> 244 1991-04-11 3.75000000
#> 245 1991-04-12 3.85000000
#> 246 1991-04-13 3.79166667
#> 247 1991-04-14 3.98333333
#> 248 1991-04-15 4.20833333
#> 249 1991-04-16 4.37500000
#> 250 1991-04-17 4.50000000
#> 251 1991-04-18 4.68333333
#> 252 1991-04-19 4.39166667
#> 253 1991-04-20 4.45833333
#> 254 1991-04-21 4.05000000
#> 255 1991-04-22 3.72500000
#> 256 1991-04-23 4.37500000
#> 257 1991-04-24 4.45000000
#> 258 1991-04-25 3.13333333
#> 259 1991-04-26 3.10000000
#> 260 1991-04-27 3.22500000
#> 261 1991-04-28 3.05000000
#> 262 1991-04-29 2.60833333
#> 263 1991-04-30 3.27500000
#> 264 1991-05-01 3.32500000
#> 265 1991-05-02 3.25000000
#> 266 1991-05-03 3.55833333
#> 267 1991-05-04 3.66666667
#> 268 1991-05-05 3.94166667
#> 269 1991-05-06 3.85000000
#> 270 1991-05-07 4.30000000
#> 271 1991-05-08 4.32500000
#> 272 1991-05-09 3.60833333
#> 273 1991-05-10 3.61666667
#> 274 1991-05-11 3.86666667
#> 275 1991-05-12 4.29166667
#> 276 1991-05-13 4.60833333
#> 277 1991-05-14 4.50833333
#> 278 1991-05-15 4.81666667
#> 279 1991-05-16 5.10000000
#> 280 1991-05-17 5.39166667
#> 281 1991-05-18 5.18333333
#> 282 1991-05-19 4.87500000
#> 283 1991-05-20 5.03333333
#> 284 1991-05-21 5.60833333
#> 285 1991-05-22 5.40000000
#> 286 1991-05-23 5.12500000
#> 287 1991-05-24 5.34166667
#> 288 1991-05-25 5.93333333
#> 289 1991-05-26 6.02500000
#> 290 1991-05-27 5.39166667
#> 291 1991-05-28 5.27500000
#> 292 1991-05-29 5.56666667
#> 293 1991-05-30 5.53333333
#> 294 1991-05-31 5.27500000
#> 295 1991-06-01 5.51666667
#> 296 1991-06-02 6.24166667
#> 297 1991-06-03 6.24166667
#> 298 1991-06-04 6.21666667
#> 299 1991-06-05 5.95000000
#> 300 1991-06-06 6.71666667
#> 301 1991-06-07 6.42500000
#> 302 1991-06-08 6.97500000
#> 303 1991-06-09 6.58333333
#> 304 1991-06-10 6.35000000
#> 305 1991-06-11 6.19166667
#> 306 1991-06-12 6.29166667
#> 307 1991-06-13 6.76666667
#> 308 1991-06-14 7.01666667
#> 309 1991-06-15 7.17500000
#> 310 1991-06-16 7.09166667
#> 311 1991-06-17 6.81666667
#> 312 1991-06-18 6.84166667
#> 313 1991-06-19 6.76666667
#> 314 1991-06-20 7.29166667
#> 315 1991-06-21 6.78333333
#> 316 1991-06-22 6.93333333
#> 317 1991-06-23 7.50833333
#> 318 1991-06-24 6.90833333
#> 319 1991-06-25 7.26666667
#> 320 1991-06-26 7.45833333
#> 321 1991-06-27 6.56666667
#> 322 1991-06-28 6.30000000
#> 323 1991-06-29 6.38333333
#> 324 1991-06-30 6.72500000
#> 325 1991-07-01 7.00000000
#> 326 1991-07-02 6.79166667
#> 327 1991-07-03 6.61666667
#> 328 1991-07-04 6.74166667
#> 329 1991-07-05 7.67500000
#> 330 1991-07-06 6.87500000
#> 331 1991-07-07 7.51666667
#> 332 1991-07-08 8.05000000
#> 333 1991-07-09 8.63333333
#> 334 1991-07-10 8.50833333
#> 335 1991-07-11 8.25833333
#> 336 1991-07-12 9.92500000
#> 337 1991-07-13 8.12500000
#> 338 1991-07-14 8.20833333
#> 339 1991-07-15 9.95000000
#> 340 1991-07-16 7.35833333
#> 341 1991-07-17 8.31666667
#> 342 1991-07-18 8.22500000
#> 343 1991-07-19 9.20000000
#> 344 1991-07-20 9.95000000
#> 345 1991-07-21 9.97500000
#> 346 1991-07-22 10.35833333
#> 347 1991-07-23 10.63333333
#> 348 1991-07-24 10.80833333
#> 349 1991-07-25 10.99166667
#> 350 1991-07-26 11.54166667
#> 351 1991-07-27 11.78333333
#> 352 1991-07-28 12.05000000
#> 353 1991-07-29 12.06666667
#> 354 1991-07-30 11.90833333
#> 355 1991-07-31 10.80000000
#> 356 1991-08-01 10.90000000
#> 357 1991-08-02 11.45833333
#> 358 1991-08-03 11.58333333
#> 359 1991-08-04 11.70000000
#> 360 1991-08-05 11.75000000
#> 361 1991-08-06 11.51666667
#> 362 1991-08-07 11.74166667
#> 363 1991-08-08 12.05833333
#> 364 1991-08-09 11.50833333
#> 365 1991-08-10 10.84166667
#> 366 1991-08-11 2.10000000
#> 367 1991-08-12 -9.90000000
#> 368 1991-08-13 2.77500000
#> 369 1991-08-14 10.65000000
#> 370 1991-08-15 9.15833333
#> 371 1991-08-16 9.06666667
#> 372 1991-08-17 9.61666667
#> 373 1991-08-18 10.32500000
#> 374 1991-08-19 9.98333333
#> 375 1991-08-20 10.45833333
#> 376 1991-08-21 10.89166667
#> 377 1991-08-22 11.36666667
#> 378 1991-08-23 11.67500000
#> 379 1991-08-24 10.82500000
#> 380 1991-08-25 8.24166667
#> 381 1991-08-26 9.46666667
#> 382 1991-08-27 10.12500000
#> 383 1991-08-28 10.21666667
#> 384 1991-08-29 10.41666667
#> 385 1991-08-30 10.61666667
#> 386 1991-08-31 11.05833333
#> 387 1991-09-01 10.55833333
#> 388 1991-09-02 10.16666667
#> 389 1991-09-03 10.38333333
#> 390 1991-09-04 10.30833333
#> 391 1991-09-05 10.51666667
#> 392 1991-09-06 10.71666667
#> 393 1991-09-07 10.65833333
#> 394 1991-09-08 9.56666667
#> 395 1991-09-09 9.23333333
#> 396 1991-09-10 9.32500000
#> 397 1991-09-11 9.82500000
#> 398 1991-09-12 10.17500000
#> 399 1991-09-13 9.92500000
#> 400 1991-09-14 8.59166667
#> 401 1991-09-15 8.58333333
#> 402 1991-09-16 8.50000000
#> 403 1991-09-17 8.40000000
#> 404 1991-09-18 8.51666667
#> 405 1991-09-19 8.65000000
#> 406 1991-09-20 8.86666667
#> 407 1991-09-21 8.87500000
#> 408 1991-09-22 8.36666667
#> 409 1991-09-23 7.85000000
#> 410 1991-09-24 7.85000000
#> 411 1991-09-25 7.86666667
#> 412 1991-09-26 7.89166667
#> 413 1991-09-27 8.08333333
#> 414 1991-09-28 8.25833333
#> 415 1991-09-29 7.94166667
#> 416 1991-09-30 7.89166667
#> 417 1991-10-01 7.94166667
#> 418 1991-10-02 8.04166667
#> 419 1991-10-03 7.86666667
#> 420 1991-10-04 7.85000000
#> 421 1991-10-05 7.85833333
#> 422 1991-10-06 7.73333333
#> 423 1991-10-07 7.45000000
#> 424 1991-10-08 7.40000000
#> 425 1991-10-09 6.88333333
#> 426 1991-10-10 6.57500000
#> 427 1991-10-11 6.39166667
#> 428 1991-10-12 6.66666667
#> 429 1991-10-13 6.58333333
#> 430 1991-10-14 5.90833333
#> 431 1991-10-15 5.76666667
#> 432 1991-10-16 6.38333333
#> 433 1991-10-17 6.54166667
#> 434 1991-10-18 6.80833333
#> 435 1991-10-19 6.71666667
#> 436 1991-10-20 5.86666667
#> 437 1991-10-21 5.47500000
#> 438 1991-10-22 5.52500000
#> 439 1991-10-23 5.71666667
#> 440 1991-10-24 5.67500000
#> 441 1991-10-25 5.56666667
#> 442 1991-10-26 5.55000000
#> 443 1991-10-27 5.70833333
#> 444 1991-10-28 5.94166667
#> 445 1991-10-29 6.08333333
#> 446 1991-10-30 6.10000000
#> 447 1991-10-31 5.92500000
#> 448 1991-11-01 6.12500000
#> 449 1991-11-02 6.14166667
#> 450 1991-11-03 6.30833333
#> 451 1991-11-04 6.20833333
#> 452 1991-11-05 6.15833333
#> 453 1991-11-06 6.16666667
#> 454 1991-11-07 6.09166667
#> 455 1991-11-08 6.02500000
#> 456 1991-11-09 5.89166667
#> 457 1991-11-10 5.72500000
#> 458 1991-11-11 5.39166667
#> 459 1991-11-12 4.68333333
#> 460 1991-11-13 4.14166667
#> 461 1991-11-14 4.13333333
#> 462 1991-11-15 3.90000000
#> 463 1991-11-16 3.71666667
#> 464 1991-11-17 3.75833333
#> 465 1991-11-18 3.31666667
#> 466 1991-11-19 2.85833333
#> 467 1991-11-20 1.64166667
#> 468 1991-11-21 1.00833333
#> 469 1991-11-22 2.60000000
#> 470 1991-11-23 3.22500000
#> 471 1991-11-24 3.08333333
#> 472 1991-11-25 3.27500000
#> 473 1991-11-26 2.80833333
#> 474 1991-11-27 2.95000000
#> 475 1991-11-28 2.99166667
#> 476 1991-11-29 3.18333333
#> 477 1991-11-30 3.26666667
#> 478 1991-12-01 2.91666667
#> 479 1991-12-02 2.97500000
#> 480 1991-12-03 3.19166667
#> 481 1991-12-04 3.30833333
#> 482 1991-12-05 3.18333333
#> 483 1991-12-06 2.41666667
#> 484 1991-12-07 1.74166667
#> 485 1991-12-08 2.21666667
#> 486 1991-12-09 1.51666667
#> 487 1991-12-10 2.42500000
#> 488 1991-12-11 2.37500000
#> 489 1991-12-12 2.09166667
#> 490 1991-12-13 1.81666667
#> 491 1991-12-14 2.11666667
#> 492 1991-12-15 2.34166667
#> 493 1991-12-16 2.10833333
#> 494 1991-12-17 1.55000000
#> 495 1991-12-18 0.74166667
#> 496 1991-12-19 0.75833333
#> 497 1991-12-20 1.48333333
#> 498 1991-12-21 0.94166667
#> 499 1991-12-22 1.03333333
#> 500 1991-12-23 1.34166667
#> 501 1991-12-24 1.56666667
#> 502 1991-12-25 1.07500000
#> 503 1991-12-26 0.66666667
#> 504 1991-12-27 1.23333333
#> 505 1991-12-28 0.90833333
#> 506 1991-12-29 1.16666667
#> 507 1991-12-30 1.09166667
#> 508 1991-12-31 1.05000000
#> 509 1992-01-01 1.16666667
#> 510 1992-01-02 1.10000000
#> 511 1992-01-03 1.11666667
#> 512 1992-01-04 0.56666667
#> 513 1992-01-05 0.60833333
#> 514 1992-01-06 0.76666667
#> 515 1992-01-07 1.02500000
#> 516 1992-01-08 1.15833333
#> 517 1992-01-09 1.06666667
#> 518 1992-01-10 0.85000000
#> 519 1992-01-11 0.65000000
#> 520 1992-01-12 0.63333333
#> 521 1992-01-13 0.95000000
#> 522 1992-01-14 1.10000000
#> 523 1992-01-15 1.20000000
#> 524 1992-01-16 1.35833333
#> 525 1992-01-17 1.49166667
#> 526 1992-01-18 1.15833333
#> 527 1992-01-19 1.37500000
#> 528 1992-01-20 1.44166667
#> 529 1992-01-21 1.43333333
#> 530 1992-01-22 1.40833333
#> 531 1992-01-23 1.50833333
#> 532 1992-01-24 1.54166667
#> 533 1992-01-25 1.53333333
#> 534 1992-01-26 1.58333333
#> 535 1992-01-27 1.58333333
#> 536 1992-01-28 1.60000000
#> 537 1992-01-29 1.57500000
#> 538 1992-01-30 1.59166667
#> 539 1992-01-31 1.60000000
#> 540 1992-02-01 1.59166667
#> 541 1992-02-02 1.60833333
#> 542 1992-02-03 1.60833333
#> 543 1992-02-04 1.59166667
#> 544 1992-02-05 1.59166667
#> 545 1992-02-06 1.60833333
#> 546 1992-02-07 1.64166667
#> 547 1992-02-08 1.64166667
#> 548 1992-02-09 1.59166667
#> 549 1992-02-10 1.60000000
#> 550 1992-02-11 1.61666667
#> 551 1992-02-12 1.59166667
#> 552 1992-02-13 1.60000000
#> 553 1992-02-14 1.61666667
#> 554 1992-02-15 1.61666667
#> 555 1992-02-16 1.59166667
#> 556 1992-02-17 1.61666667
#> 557 1992-02-18 1.62500000
#> 558 1992-02-19 1.60833333
#> 559 1992-02-20 1.60833333
#> 560 1992-02-21 1.55833333
#> 561 1992-02-22 1.59166667
#> 562 1992-02-23 1.60000000
#> 563 1992-02-24 1.58333333
#> 564 1992-02-25 1.60833333
#> 565 1992-02-26 1.67500000
#> 566 1992-02-27 1.63333333
#> 567 1992-02-28 1.60833333
#> 568 1992-02-29 1.59166667
#> 569 1992-03-01 1.61666667
#> 570 1992-03-02 1.60000000
#> 571 1992-03-03 1.57500000
#> 572 1992-03-04 1.60833333
#> 573 1992-03-05 1.62500000
#> 574 1992-03-06 1.60833333
#> 575 1992-03-07 1.56666667
#> 576 1992-03-08 1.66666667
#> 577 1992-03-09 1.66666667
#> 578 1992-03-10 1.74166667
#> 579 1992-03-11 1.70833333
#> 580 1992-03-12 1.70833333
#> 581 1992-03-13 1.75833333
#> 582 1992-03-14 1.80000000
#> 583 1992-03-15 1.90833333
#> 584 1992-03-16 2.03333333
#> 585 1992-03-17 2.15833333
#> 586 1992-03-18 2.03333333
#> 587 1992-03-19 2.01666667
#> 588 1992-03-20 2.03333333
#> 589 1992-03-21 2.02500000
#> 590 1992-03-22 2.07500000
#> 591 1992-03-23 2.09166667
#> 592 1992-03-24 2.09166667
#> 593 1992-03-25 2.04166667
#> 594 1992-03-26 2.17500000
#> 595 1992-03-27 2.22500000
#> 596 1992-03-28 2.25000000
#> 597 1992-03-29 2.29166667
#> 598 1992-03-30 2.34166667
#> 599 1992-03-31 2.32500000
#> 600 1992-04-01 2.45000000
#> 601 1992-04-02 2.50833333
#> 602 1992-04-03 2.60833333
#> 603 1992-04-04 2.69166667
#> 604 1992-04-05 2.84166667
#> 605 1992-04-06 3.00000000
#> 606 1992-04-07 3.22500000
#> 607 1992-04-08 3.36666667
#> 608 1992-04-09 3.52500000
#> 609 1992-04-10 3.65833333
#> 610 1992-04-11 3.87500000
#> 611 1992-04-12 4.07500000
#> 612 1992-04-13 4.30833333
#> 613 1992-04-14 4.28333333
#> 614 1992-04-15 4.27500000
#> 615 1992-04-16 4.45833333
#> 616 1992-04-17 4.52500000
#> 617 1992-04-18 4.53333333
#> 618 1992-04-19 4.55000000
#> 619 1992-04-20 4.56666667
#> 620 1992-04-21 4.41666667
#> 621 1992-04-22 4.46666667
#> 622 1992-04-23 4.43333333
#> 623 1992-04-24 4.43333333
#> 624 1992-04-25 4.47500000
#> 625 1992-04-26 4.39166667
#> 626 1992-04-27 4.42500000
#> 627 1992-04-28 4.44166667
#> 628 1992-04-29 4.46666667
#> 629 1992-04-30 4.50000000
#> 630 1992-05-01 4.54166667
#> 631 1992-05-02 4.42500000
#> 632 1992-05-03 4.45000000
#> 633 1992-05-04 4.26666667
#> 634 1992-05-05 4.25833333
#> 635 1992-05-06 3.43333333
#> 636 1992-05-07 3.36666667
#> 637 1992-05-08 3.45000000
#> 638 1992-05-09 3.06666667
#> 639 1992-05-10 3.16666667
#> 640 1992-05-11 3.41666667
#> 641 1992-05-12 3.47500000
#> 642 1992-05-13 3.66666667
#> 643 1992-05-14 3.90833333
#> 644 1992-05-15 3.85833333
#> 645 1992-05-16 3.75000000
#> 646 1992-05-17 3.91666667
#> 647 1992-05-18 4.12500000
#> 648 1992-05-19 4.43333333
#> 649 1992-05-20 5.10833333
#> 650 1992-05-21 6.23333333
#> 651 1992-05-22 6.50000000
#> 652 1992-05-23 6.72500000
#> 653 1992-05-24 6.89166667
#> 654 1992-05-25 7.04166667
#> 655 1992-05-26 7.23333333
#> 656 1992-05-27 7.66666667
#> 657 1992-05-28 7.25000000
#> 658 1992-05-29 7.68333333
#> 659 1992-05-30 8.15000000
#> 660 1992-05-31 7.35833333
#> 661 1992-06-01 7.22500000
#> 662 1992-06-02 7.62500000
#> 663 1992-06-03 7.80000000
#> 664 1992-06-04 7.72500000
#> 665 1992-06-05 7.41666667
#> 666 1992-06-06 7.28333333
#> 667 1992-06-07 6.89166667
#> 668 1992-06-08 6.48333333
#> 669 1992-06-09 6.79166667
#> 670 1992-06-10 7.05833333
#> 671 1992-06-11 8.15000000
#> 672 1992-06-12 7.22500000
#> 673 1992-06-13 7.31666667
#> 674 1992-06-14 7.75833333
#> 675 1992-06-15 7.10000000
#> 676 1992-06-16 8.27500000
#> 677 1992-06-17 7.85833333
#> 678 1992-06-18 7.65000000
#> 679 1992-06-19 7.60000000
#> 680 1992-06-20 7.00833333
#> 681 1992-06-21 7.07500000
#> 682 1992-06-22 7.47500000
#> 683 1992-06-23 6.70000000
#> 684 1992-06-24 6.92500000
#> 685 1992-06-25 7.32500000
#> 686 1992-06-26 7.05833333
#> 687 1992-06-27 7.29166667
#> 688 1992-06-28 7.24166667
#> 689 1992-06-29 7.45833333
#> 690 1992-06-30 6.80833333
#> 691 1992-07-01 7.50000000
#> 692 1992-07-02 7.77500000
#> 693 1992-07-03 8.16666667
#> 694 1992-07-04 9.44166667
#> 695 1992-07-05 8.57500000
#> 696 1992-07-06 7.88333333
#> 697 1992-07-07 7.27500000
#> 698 1992-07-08 7.59166667
#> 699 1992-07-09 7.66666667
#> 700 1992-07-10 8.01666667
#> 701 1992-07-11 6.86666667
#> 702 1992-07-12 7.32500000
#> 703 1992-07-13 7.66666667
#> 704 1992-07-14 7.79166667
#> 705 1992-07-15 8.18333333
#> 706 1992-07-16 8.30000000
#> 707 1992-07-17 8.94166667
#> 708 1992-07-18 9.50000000
#> 709 1992-07-19 10.18333333
#> 710 1992-07-20 10.65000000
#> 711 1992-07-21 10.53333333
#> 712 1992-07-22 8.85000000
#> 713 1992-07-23 9.05833333
#> 714 1992-07-24 9.10000000
#> 715 1992-07-25 10.37500000
#> 716 1992-07-26 10.68333333
#> 717 1992-07-27 11.39166667
#> 718 1992-07-28 11.67500000
#> 719 1992-07-29 11.70000000
#> 720 1992-07-30 12.54166667
#> 721 1992-07-31 12.90000000
#> 722 1992-08-01 13.12500000
#> 723 1992-08-02 13.84166667
#> 724 1992-08-03 13.15000000
#> 725 1992-08-04 12.69166667
#> 726 1992-08-05 13.57500000
#> 727 1992-08-06 16.27500000
#> 728 1992-08-07 18.80000000
#> 729 1992-08-08 18.80000000
#> 730 1992-08-09 18.81666667
#> 731 1992-08-10 19.29166667
#> 732 1992-08-11 28.70000000
#> 733 1992-08-12 19.71666667
#> 734 1992-08-13 17.71666667
#> 735 1992-08-14 17.68000000
summary(woody_island)
#> date temp_c
#> Min. :1990-08-11 Min. :-9.900
#> 1st Qu.:1991-02-10 1st Qu.: 1.733
#> Median :1991-08-13 Median : 4.442
#> Mean :1991-08-13 Mean : 5.272
#> 3rd Qu.:1992-02-12 3rd Qu.: 7.767
#> Max. :1992-08-14 Max. :28.700
You can see that each day already is summarized as a mean
temperature. You can also see that the data spans multiple years. We’ll
use plot_check_temp()
to make visually check the data:
There appear to be outliers in the data, specifically in the very beginning and end of the period of record, and right in the middle. The loggers look to have been recording observations outside of the water and then in the middle where the water level may have dropped and exposed it to the air.
However, spawning in this system typically peaks around August 18 and
hatching and emergence are done before the start of the following
spawning season, so we can predict phenology within a subset of a year.
Because plot_check_temp()
is a ggplot2
object, we can add additional plotting elements to the graph to
represent the approximate phenology window:
p +
geom_rect(
aes(
xmin = ymd("1990-08-18"),
xmax = ymd("1991-04-01"),
ymin = -10,
ymax = 25
),
fill = "gray",
alpha = 0.01
)
If we just apply the model within the gray polygon we’ve drawn, the model should work just fine.
Now that our temperature data is usable, we can select our models.
We’ll predict both hatch and emergence, so we will obtain a model
expression for each using model_select()
. The only argument
in model_select()
that must be changed in this case is
development_type
, which can be either “hatch” or
“emerge”.
sockeye_hatch_mod <- model_select(
author = "Beacham and Murray 1990",
species = "sockeye",
model = 2,
development_type = "hatch"
)
sockeye_emerge_mod <- model_select(
author = "Beacham and Murray 1990",
species = "sockeye",
model = 2,
development_type = "emerge"
)
Let’s look at the model specifications for the two different parameterizations we’ve selected:
sockeye_hatch_mod
#> # A tibble: 1 × 5
#> author species model_id development_type expression
#> <chr> <chr> <chr> <chr> <chr>
#> 1 Beacham and Murray 1990 sockeye 2 hatch 1 /exp(6.727 - log(…
sockeye_emerge_mod
#> # A tibble: 1 × 5
#> author species model_id development_type expression
#> <chr> <chr> <chr> <chr> <chr>
#> 1 Beacham and Murray 1990 sockeye 2 emerge 1 / exp(7.227 - log…
You can see they are parameterized slightly different to account for the differences between hatch and emergence timing.
We can now use our model expressions to predict when sockeye would
hatch and emerge at Woody Island in 1990. First we predict hatch timing
using predict_phenology()
:
WI_hatch <- predict_phenology(
data = woody_island,
dates = date,
temperature = temp_c,
spawn.date = "1990-08-18",
model = sockeye_hatch_mod
)
#> Warning: ! Fish developed, but negative temperature values resulted in NaNs after
#> development.
#> ℹ Check date(s): 1991-08-12
#> ℹ Fish spawn date was: 1990-08-18
Note the warning message that appears when you run this code for
woody_island
. It reveals that while the fish developed, negative temperature values resulted inNaN
s after development. More on this in the Negative Temperature section.
Next, look inside the returned object to see days to hatch and development period (more on this in the Understanding your results section)
We can also do the same with emergence:
WI_emerge <- predict_phenology(
data = woody_island,
dates = date,
temperature = temp_c,
spawn.date = "1990-08-18",
model = sockeye_emerge_mod # notice we're using emerge model expression here
)
#> Warning: ! Fish developed, but negative temperature values resulted in NaNs after
#> development.
#> ℹ Check date(s): 1991-08-12
#> ℹ Fish spawn date was: 1990-08-18
WI_emerge$days_to_develop
#> [1] 204
WI_emerge$dev.period
#> start stop
#> 1 1990-08-18 1991-03-09
The output from predict_phenology()
includes a lot of
information. Here is a summary of the elements in the output list.
summary(WI_hatch)
#> Length Class Mode
#> days_to_develop 1 -none- numeric
#> dev.period 2 data.frame list
#> ef_table 5 tbl_df list
#> model_specs 5 spec_tbl_df list
We can access each element using the $
operator:
WI_hatch$days_to_develop
outputs the predicted days
to hatch or emerge.
WI_hatch$dev.period
is a 1x2 dataframe with the
dates corresponding to when your fish’s parent spawned (which you input
with predict_phenology(spawn.date = ...)
) and the date when
the fish is predicted to hatch or emerge.
WI_hatch$ef.tibble
is a n x 5 tibble
(n = number of days to hatch or emerge) and the columns are a
row index, the date, each day’s temperature, effective value, and the
cumulative sum of the effective values to that date. The
ef.tibble
object is meant to serve as the basis for users
to make custom figures for their data beyond the functionality we
discuss below.
WI_hatch$model.specs
is a tibble showing the model
specifications used to predict the phenology.
hatchR has a built in function,
plot_phenology()
, that allows users to visualize their
phenology results. The plot visualizes three specific components:
The function allows you to output various figures based on your interests, but defaults to a figure with all information and lots of labeling.
In the output of plot_phenology()
the cumulative
effective values are scaled by the warmest temperature in
ef.tibble
and the daily effective values are
scaled by multiplying by 100 so everything is visibly congruent in the
figure.
Let’s look at the basic call, which gives you all the information:
You can turn of labeling or plot specific values using the function
arguments style
and labels
, for example (plots
not rendered):
Occasionally, temperature data sets will have a few negative values
or values very close to 0. Negative numbers below a certain threshold
will output “not a number” (NaN
) effective values because
they are undefined in the model expression and will break the function.
Similarly, even negative values above that threshold will produce very
small effective values. Because these values are so small, we allow the
model to accumulate them even though development below 0 is biologically
unlikely. We assume your data set has been checked for
these values and doesn’t include long periods of freezing, however the
model allows for the occasional dip below freezing because the effect is
so negligible toward development over incubation.
A toy example of this phenomenon is shown below.
# vector of temps from -5 to 15 by 0.5
x <- seq(from = -5, to = 15, by = 0.5)
x
#> [1] -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0
#> [16] 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5
#> [31] 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5 15.0
# get effective values for those temperatures
# You can see the NaN warning that shows up in our past applications
demo_ef_vals <- eval(parse(text = sockeye_hatch_mod$expression))
demo_ef_vals
#> [1] NaN NaN NaN NaN NaN NaN
#> [7] 0.000472060 0.001071121 0.001670182 0.002269243 0.002868304 0.003467365
#> [13] 0.004066426 0.004665487 0.005264548 0.005863609 0.006462670 0.007061731
#> [19] 0.007660792 0.008259853 0.008858914 0.009457975 0.010057036 0.010656097
#> [25] 0.011255157 0.011854218 0.012453279 0.013052340 0.013651401 0.014250462
#> [31] 0.014849523 0.015448584 0.016047645 0.016646706 0.017245767 0.017844828
#> [37] 0.018443889 0.019042950 0.019642011 0.020241072 0.020840133
# bring together as a tibble
demo <- tibble(x, demo_ef_vals)
demo
#> # A tibble: 41 × 2
#> x demo_ef_vals
#> <dbl> <dbl>
#> 1 -5 NaN
#> 2 -4.5 NaN
#> 3 -4 NaN
#> 4 -3.5 NaN
#> 5 -3 NaN
#> # ℹ 36 more rows
# plot (note NaNs are removed from figure)
# rectangle added to highlight the approximate temperatures of interest
demo |>
ggplot(aes(x = x, y = demo_ef_vals)) +
geom_rect(
aes(
ymin = 0, ymax = 0.005,
xmin = -5, xmax = 2
),
fill = "dodgerblue", alpha = 0.25
) +
geom_point() +
geom_line() +
labs(x = "Temperature (C)", y = "Effective Value") +
theme_classic()
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.