-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemp_report.Rmd
More file actions
65 lines (50 loc) · 1.36 KB
/
temp_report.Rmd
File metadata and controls
65 lines (50 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: "Pest Growth Simulation Report"
date: "`r Sys.Date()`"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
```{r echo=FALSE}
# invalid function
invalid <- function(x){
if (missing(x) || is.null(x) || length(x) == 0 || is(x, "try-error")) {
return(TRUE)
}
if (is.list(x)) {
return(all(sapply(x, invalid)))
}
else if (is.vector(x)) {
return(all(is.na(x)))
}
else {
return(FALSE)
}
}
```
Report generated by the [Predict-A-Pest web app](http://ec2-52-65-31-166.ap-southeast-2.compute.amazonaws.com/predict-a-pest/).
## Selected Location:
Longitude: *`r params$long`*
Latitude: *`r params$lat`*
Region: *`r params$region`*
## Crop information
Crop: *`r params$crop`*
Crop stage of interest: *`r params$stage`*
## Predicted plot
```{r , echo=FALSE, out.width = '100%'}
knitr::include_graphics("phenology.png")
# print(params$plot_pest)
```
## Management action
Potential impacts during risk periods (red bars): \
*`r ifelse(invalid(params$impact1), "No potential impacts are provided.", params$impact1)`* \
*`r ifelse(invalid(params$impact2), "", params$impact2)`*
\
\
Regional considersation (`r params$region` region): \
*`r ifelse(invalid(params$mngaction), "No regional consideration is provided.", params$mngaction)`*
## Table of simulated pest growth
```{r}
knitr::kable(params$dt_pest)
```