79275484

Date: 2024-12-12 14:34:27
Score: 2.5
Natty:
Report link

Something like this?

df %>% 
  group_by(N2000) %>%
  mutate(area = ifelse(N2000== "Yes",SurfaceN2000, Total_Surface )) %>%
  summarise(surface= sum(area, na.rm = T))

# A tibble: 2 × 2
  N2000 surface
  <chr>   <dbl>
1 No       16  
2 Yes       5.5
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: Luigi