i have a function that returns averaged timeseries (using package hydroTSM). However, i want not only to output the averages but also to create a variable with specified name ("d2m"+argument name), so i can access those values later. This is what I've come up so far.
d2m = function(var) {
d2m = daily2monthly(var, FUN = mean)
assign(paste('d2m', var, sep = ''), d2m)
}
I was yet not able to create the output variable. For function argument var=123 i should get a variable called d2m123 with the timeseries as a value. Thanks.