[This is what my dataframe looks like](https://i.stack.imgur.com/GyuZh.png)

I have a dataframe of several columns and several rows per Participant\_ID.
I want to sum data for all lines of Participant\_ID, to obtain one value per Participant\_ID.
The problem is that some columns are empty (all NAs), and for these columns I want to keep NA as a result.
But when I sum with na.rm = T, it transforms the sum of NAs to 0.

I am using :

```
 df = df %>%
  group_by(Participant_ID) %>%
  summarise(across(where(is.numeric), ~ sum(.x, na.rm = T)))

```

How can I exclude columns (after group\_by) with only NAs ? Or filter columns (after group\_by) that contain at least one numeric value ?

Thanks a lot for your help !!