79480646

Date: 2025-03-03 09:44:42
Score: 0.5
Natty:
Report link

According to your approach by using group_by and summarise, which can be changed as:

df_summed <- df %>%
  group_by(sample) %>%
  summarise(
    across(starts_with("var"), first),  # Keep first value of abiotic variables
    across(starts_with("species"), sum)  # Sum the species abundance values
  )
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Qian