Hi, I am not so experienced yet with the use of functions and loops in Rstudio. Hence, the following question.

I have the following function:

*dl <- function(lat_radians,solar_declination){*

- dl <- (24/pi)*(acos((-tan(lat_radians))
*tan(solar_declination)))*

*}*

lat_radians = num[1:4000] (can also be df$lat_radians if easier) and solar_declination = num [1:365].

As a result, I want a data.frame that gives 'dl' for each lat_radians (row) multiplied by every solar_declination seperately (365 columns). So, iterations for full solar_declination[1:365]

The function itself works. However it only gives values for solar_declination[1].

Anyone who has a suggestion on how to accomplish this?