I fully support using an existing function to do this if the outcome is all that matters. If the goal is to learn about function, then I suggest modifying the function as follows.
library(dplyr)
yahoo <- data.frame(Ticker = c("HD", "WMT", "NVDA"),
metric1 = c(1,6,1), metric2 = c(3,8,2), metric3 = c(4,2,3))
metrica <- function(x) {
yahoo %>% select(1, Value = x + 1)
}
n <- length(colnames(yahoo))-1
total <- bind_rows(lapply(1:n,metrica))
total
#> Ticker Value
#> 1 HD 1
#> 2 WMT 6
#> 3 NVDA 1
#> 4 HD 3
#> 5 WMT 8
#> 6 NVDA 2
#> 7 HD 4
#> 8 WMT 2
#> 9 NVDA 3
Created on 2020-05-30 by the reprex package (v0.3.0)
What you were trying to do inside the select() function by setting 'metric' = x + 1 will not work. It is easier to just use the numeric positions of the desired columns. I did use the select() function to rename the second selected column, so the data frames would all have the same column names and could be bound together.