comparison insect_phenology_model.R @ 81:5729eb737082 draft

Uploaded
author greg
date Tue, 14 Nov 2017 14:57:26 -0500
parents b701a134d640
children 0c807f99a816
comparison
equal deleted inserted replaced
80:b701a134d640 81:5729eb737082
26 opt <- args$options 26 opt <- args$options
27 27
28 parse_input_data = function(input_file, num_rows) { 28 parse_input_data = function(input_file, num_rows) {
29 # Read in the input temperature datafile into a data frame. 29 # Read in the input temperature datafile into a data frame.
30 temperature_data_frame <- read.csv(file=input_file, header=T, strip.white=TRUE, sep=",") 30 temperature_data_frame <- read.csv(file=input_file, header=T, strip.white=TRUE, sep=",")
31 if (ncol(temperature_data_frame) == 6) { 31 if (dim(temperature_data_frame)[2] == 6) {
32 # The input data has the following 6 columns: 32 # The input data has the following 6 columns:
33 # LATITUDE, LONGITUDE, DATE, DOY, TMIN, TMAX 33 # LATITUDE, LONGITUDE, DATE, DOY, TMIN, TMAX
34 # Add a column containing the daylight length for each day. 34 # Add a column containing the daylight length for each day.
35 temperature_data_frame <- add_daylight_length(latitude, temperature_data_frame, num_rows) 35 temperature_data_frame <- add_daylight_length(latitude, temperature_data_frame, num_rows)
36 } 36 }