comparison insect_phenology_model.R @ 28:3ef94dce7454 draft

Uploaded
author greg
date Thu, 09 Nov 2017 11:40:32 -0500
parents 24949e72f7ec
children 4d38c1789ae0
comparison
equal deleted inserted replaced
27:24949e72f7ec 28:3ef94dce7454
201 # Read in the input temperature datafile into a Data Frame object. 201 # Read in the input temperature datafile into a Data Frame object.
202 temperature_data <- read.csv(file=opt$input, header=T, sep=",") 202 temperature_data <- read.csv(file=opt$input, header=T, sep=",")
203 temperature_file_path <- convert_csv_to_rdata(opt$location, temperature_data) 203 temperature_file_path <- convert_csv_to_rdata(opt$location, temperature_data)
204 latitude <- temperature_data[1, 1] 204 latitude <- temperature_data[1, 1]
205 205
206 cat("Number of days: ", opt$num_days, ", ") 206 cat("Number of days: ", opt$num_days, "\n")
207 cat("Latitude: ", latitude, "\n") 207 cat("Latitude: ", latitude, "\n")
208 cat("Replications: ", opt$replications, ", ") 208 cat("Replications: ", opt$replications)
209 cat("Photoperiod: ", opt$photoperiod, "\n")
210 cat("Oviposition rate: ", opt$oviposition, ", ")
211 cat("Egg mortality rate: ", opt$egg_mort, "\n")
212 cat("Nymph mortality rate: ", opt$nymph_mort, ", ")
213 cat("Adult mortality rate: ", opt$adult_mort, "\n")
214 cat("Min clutch size: ", opt$min_clutch_size, ", ")
215 cat("Max clutch size: ", opt$max_clutch_size, "\n")
216 cat("(egg->young nymph): ", opt$young_nymph_accum, ", ")
217 cat("(young nymph->old nymph): ", opt$old_nymph_accum, "\n")
218 cat("(old nymph->adult): ", opt$adult_accum)
219 209
220 # Initialize matrix for results from all replications. 210 # Initialize matrix for results from all replications.
221 S0.rep <- S1.rep <- S2.rep <- S3.rep <- S4.rep <- S5.rep <- matrix(rep(0, opt$num_days * opt$replications), ncol = opt$replications) 211 S0.rep <- S1.rep <- S2.rep <- S3.rep <- S4.rep <- S5.rep <- matrix(rep(0, opt$num_days * opt$replications), ncol = opt$replications)
222 newborn.rep <- death.rep <- adult.rep <- pop.rep <- g0.rep <- g1.rep <- g2.rep <- g0a.rep <- g1a.rep <- g2a.rep <- matrix(rep(0, opt$num_days * opt$replications), ncol=opt$replications) 212 newborn.rep <- death.rep <- adult.rep <- pop.rep <- g0.rep <- g1.rep <- g2.rep <- g0a.rep <- g1a.rep <- g2a.rep <- matrix(rep(0, opt$num_days * opt$replications), ncol=opt$replications)
223 213