Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CSIRO-INRA
landsepi
Commits
2f7ce05b
Commit
2f7ce05b
authored
Apr 21, 2021
by
Loup
Browse files
change AUDPC and add AUDPC_rel
parent
3c32e772
Changes
4
Hide whitespace changes
Inline
Side-by-side
R/Methods-LandsepiParams.R
View file @
2f7ce05b
...
...
@@ -2068,7 +2068,7 @@ loadOutputs <- function(epid_outputs = "all", evol_outputs = "all"){
,
evol_outputs
=
evol_outputs
,
thres_breakdown
=
50000
,
GLAnoDis
=
1.48315
,
audpc100S
=
0.
38
)
,
audpc100S
=
0.
76
)
return
(
outputList
)
}
...
...
R/RcppExports.R
View file @
2f7ce05b
...
...
@@ -118,7 +118,7 @@
#' L = as.numeric(cultivars$yield_L),
#' I = as.numeric(cultivars$yield_I),
#' R = as.numeric(cultivars$yield_R)),
#' p
roduction
_cost_perHa = as.numeric(cultivars$p
roduction
_cost),
#' p
lanting
_cost_perHa = as.numeric(cultivars$p
lanting
_cost),
#' market_value = as.numeric(cultivars$market_value))
#'
#' evol_res <- evol_output(, time_param, Npoly, cultivars, genes)
...
...
R/output.R
View file @
2f7ce05b
...
...
@@ -110,7 +110,7 @@
epid_output
<-
function
(
types
=
"all"
,
time_param
,
Npatho
,
area
,
rotation
,
croptypes
,
cultivars_param
,
eco_param
,
GLAnoDis
=
cultivars_param
$
max_density
[
1
]
## true for non-growing host
,
ylim_param
=
list
(
audpc
=
c
(
0
,
0.38
),
audpc
=
c
(
0
,
0.76
),
#
0.38),
audpc_rel
=
c
(
0
,
1
),
gla
=
c
(
0
,
1.48
),
gla_rel
=
c
(
0
,
1
),
...
...
@@ -356,7 +356,11 @@ epid_output <- function(types = "all", time_param, Npatho, area, rotation, cropt
switch
(
type
,
"audpc"
=
{
numerator
<-
sum
(
as.numeric
(
I_host
[
host
,
ts_year
]),
as.numeric
(
R_host
[
host
,
ts_year
]))
denominator
<-
sum
(
as.numeric
(
K_host
[
host
,
y
]
*
length
(
ts_year
)))
denominator
<-
nTSpY
*
areaTot
## sum(as.numeric(K_host[host, y] * length(ts_year)))
},
"audpc_rel"
=
{
numerator
<-
sum
(
as.numeric
(
I_host
[
host
,
ts_year
]),
as.numeric
(
R_host
[
host
,
ts_year
]))
denominator
<-
sum
(
as.numeric
(
N_host
[
host
,
ts_year
]))
},
"gla"
=
{
numerator
<-
sum
(
as.numeric
(
H_host
[
host
,
ts_year
]))
...
...
@@ -384,9 +388,16 @@ epid_output <- function(types = "all", time_param, Npatho, area, rotation, cropt
## metrics for all landscape
switch
(
type
,
"audpc"
=
{
# "audpc" = {
# numerator_tot <- sum(as.numeric(I_host[, ts_year]), as.numeric(R_host[, ts_year]))
# denominator_tot <- sum(as.numeric(K_host[, y] * length(ts_year)))
# if (denominator_tot > 0) {
# output_matrix[y, "total"] <- numerator_tot / denominator_tot
# }
# },
"audpc_rel"
=
{
numerator_tot
<-
sum
(
as.numeric
(
I_host
[,
ts_year
]),
as.numeric
(
R_host
[,
ts_year
]))
denominator_tot
<-
sum
(
as.numeric
(
K
_host
[,
y
]
*
length
(
ts_year
)
))
denominator_tot
<-
sum
(
as.numeric
(
N
_host
[,
ts_year
]
))
if
(
denominator_tot
>
0
)
{
output_matrix
[
y
,
"total"
]
<-
numerator_tot
/
denominator_tot
}
...
...
@@ -398,7 +409,7 @@ epid_output <- function(types = "all", time_param, Npatho, area, rotation, cropt
output_matrix
[
y
,
"total"
]
<-
numerator_tot
/
denominator_tot
}
},
{
## i.e. if gla | substr(type,1,3)=="eco"
{
## i.e. if
audpc |
gla | substr(type,1,3)=="eco"
output_matrix
[
y
,
"total"
]
<-
sum
(
output_matrix
[
y
,
1
:
Nhost
],
na.rm
=
TRUE
)
}
)
...
...
@@ -436,7 +447,11 @@ epid_output <- function(types = "all", time_param, Npatho, area, rotation, cropt
switch
(
type
,
"audpc"
=
{
main_output
<-
"AUDPC"
ylab_output
<-
"Proportion of diseased hosts: (I+R)/K"
ylab_output
<-
expression
(
"Equivalent nb of diseased hosts / time step / m"
^
2
)
## expression('title'^2)
round_ylab_output
<-
2
},
"audpc_rel"
=
{
main_output
<-
expression
(
"Relative AUDPC"
)
ylab_output
<-
"Proportion of diseased hosts: (I+R)/N"
round_ylab_output
<-
2
},
"gla"
=
{
main_output
<-
expression
(
"Green leaf area (GLA)"
)
## expression('title'[2])
...
...
R/simul_landsepi.R
View file @
2f7ce05b
...
...
@@ -241,7 +241,7 @@ simul_landsepi <- function(seed = 12345, time_param = list(Nyears = 20, nTSpY =
genes
,
landscape
=
NULL
,
area
,
rotation
,
basic_patho_param
,
disp_patho
,
disp_host
,
pI0
=
5e-4
,
epid_outputs
=
"all"
,
evol_outputs
=
"all"
,
thres_breakdown
=
50000
,
GLAnoDis
=
1.48315
,
audpc100S
=
0.38
,
GLAnoDis
=
1.48315
,
audpc100S
=
0.76
,
#
0.38,
writeTXT
=
TRUE
,
graphic
=
TRUE
,
videoMP4
=
FALSE
,
keepRawResults
=
FALSE
)
{
# Host parameters
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment