I have a timeseries data and I want to run the code for 1 year and break before iterating the process for next year. Can anyone help me with this? So far my code looks like this.
LR= 0.004 #Mean lapse rate
L_Tmean = array(dim=c(length(Met_data), length(elevation_bands)))
for (i in 1:length(elevation_bands)){
if (length(Met_data) > 366){ break}
else{ L_Tmean[,i] = Met_data$Temp- LR*(elevation_bands[i]-Jasper_elevation)
print(i)
}
}
This is not providing me what I want. Thank you for your help.