Skip to content

Commit

Permalink
Merge pull request #1 from marruett/Cory_comments
Browse files Browse the repository at this point in the history
Cory comments
  • Loading branch information
CWWhitney authored Jan 23, 2019
2 parents db31d70 + 8fd4666 commit 0c4c561
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Calluna_model_new_prophy.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,24 @@ library(decisionSupport)
library(tidyverse)

setwd("C:/Users/ZEF/Desktop/Calluna_Folder")

#avoid using 'new' in your titles. Imagine that we will look back at this long after your PhD for ideas, when we both have grey beards. It will no longer be 'new'
Calluna_model_new_prophy <- function(x, varnames){

#Calculate the plant amount of whole production area
original_plant_number <- production_area * plants_per_ha

#Define risky months
#Define risky months (May to August)
weather_arguments_for_infection <- c(0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0)

#Simulate the infection risk for each month under uncertainty
#risk_per_month <- runif(4, 0, (infection_risk>=0)) * weather_arguments_for_infection
#add more notes in the file mate

risk_per_month <- vv(infection_risk, var_CV, 12)* weather_arguments_for_infection
risk_per_month <- sapply(risk_per_month, function(x) max(c(min(c(1,x)),0)))

#Settings for factors in % so that they will not be higher 1 or lower
#random values are elected out of pre-defined intervalls
#For NORMAL prophylactic application
#Settings for factors in % so that they will not be higher or lower than 1
#random values are selected out of pre-defined intervalls
#Calculate risks for NORMAL prophylactic application
fungus_possibility <- vv(fungus_possibility_N, var_CV, 12)* weather_arguments_for_infection
fungus_possibility_N <- sapply(fungus_possibility, function(x) max(c(min(c(1,x)),0)))

Expand Down

0 comments on commit 0c4c561

Please sign in to comment.