0

I have a table with Year column from 1962 to 2010 and then Columns from Abraxas_grossulariata to Zeuzera_pyrina. I want to sum the rows for each year and to have one final value of the sum of this.

I tried the code:

TolnaSum <- Tolna %>% group_by(Year) %>% summarise(count=sum(c(Abraxas_grossulariata:Zeuzera_pyrina)))

This produced a table I wanted but has not summed it together correctly.

stefan
  • 90,330
  • 6
  • 25
  • 51
  • Try `TolnaSum <- Tolna %>% group_by(Year) %>% summarise(count=rowSums(across(Abraxas_grossulariata:Zeuzera_pyrina)))` – stefan Dec 05 '22 at 17:35

0 Answers0