For every value of latitude in a dataframe, I am calculating the daylength for each day (total 365 days) of the year. So, I have used for-loop to loop over the rows of dataframe and used while-loop to represent the day of year. But, I am not sure how to save the output.
for (i in 1:dim(df)[1]){
j<-1
while(j<=365){
output<-daylength(lat=df$latitude[i],doy=j)
j<-j+1
# save output
}
}