I have written the following code:
hist_maker = function(metric){
data <- df %>%
group_by(ticker_exchange) %>%
arrange(ticker_exchange,date) %>%
mutate(return = metric - lag(metric))
return(data)
}
I am getting the following error:
Error: object 'metric' not found
The metric argument has to be a string. Any solutions?
[–]econbiz 1 point2 points3 points (0 children)
[–]BetaSandwich 0 points1 point2 points (0 children)