我试图使用dplyr在数据框中扩展corr列,但row_number继续失败
> o<- out %>% group_by(site) %>% mutate(row = paste0("corr", row_number()))
Error in rank(x, ties.method = "first", na.last = "keep") :
argument "x" is missing, with no default
>dput(out)
structure(list(site = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("2001", "2002",
"2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010",
"2011", "2012", "2013", "2014", "2015", "2016", "2017", "2020",
"2021", "2022", "2102", "2107", "2108"), class = "factor"), corr = c(1,
0.96999258460714, 0.940002658241897, …Run Code Online (Sandbox Code Playgroud)