Here is what I get running the data and code you posted. The only change I made to the data was to change two Na value to NA in the TR column. Note that the Id 0366 was read as a number and it displays as 366. I did not bother to change that since it is harmless for the purpose of this example. You should be able to copy the code below and run it, getting the same result.
library(dplyr)
notimesw <- structure(list(Id = c(366L, 366L, 3960L, 3960L, 1503L, 1503L,
1503L, 1503L, 366L, 366L, 3960L, 3960L),
date = c("2016-04-12",
"2016-04-12", "2016-04-15", "2016-04-15", "2016-04-17", "2016-04-17",
"2016-05-12", "2016-05-17", "2016-05-16", "2016-05-11", "2016-05-08",
"2016-05-08"),
WP = c(96L, NA, 86L, NA, NA, 25L, NA, 92L, 81L,
NA, NA, 75L),
TR = c(NA, 2L, NA, 2L, 1L, NA, 2L, NA, NA, 1L,
2L, NA),
TM = c(NA, 34L, NA, 40L, 70L, NA, 70L, NA, NA, 28L,
35L, NA)),
class = "data.frame", row.names = c(NA, -12L))
notimesw
#> Id date WP TR TM
#> 1 366 2016-04-12 96 NA NA
#> 2 366 2016-04-12 NA 2 34
#> 3 3960 2016-04-15 86 NA NA
#> 4 3960 2016-04-15 NA 2 40
#> 5 1503 2016-04-17 NA 1 70
#> 6 1503 2016-04-17 25 NA NA
#> 7 1503 2016-05-12 NA 2 70
#> 8 1503 2016-05-17 92 NA NA
#> 9 366 2016-05-16 81 NA NA
#> 10 366 2016-05-11 NA 1 28
#> 11 3960 2016-05-08 NA 2 35
#> 12 3960 2016-05-08 75 NA NA
notimesw %>% group_by(date,Id) %>%
summarize(WP=mean(WP,na.rm=TRUE),
TR=mean(TR,na.rm=TRUE),
TM=mean(TM,na.rm=TRUE))
#> `summarise()` has grouped output by 'date'. You can override using the `.groups` argument.
#> # A tibble: 8 x 5
#> # Groups: date [8]
#> date Id WP TR TM
#> <chr> <int> <dbl> <dbl> <dbl>
#> 1 2016-04-12 366 96 2 34
#> 2 2016-04-15 3960 86 2 40
#> 3 2016-04-17 1503 25 1 70
#> 4 2016-05-08 3960 75 2 35
#> 5 2016-05-11 366 NaN 1 28
#> 6 2016-05-12 1503 NaN 2 70
#> 7 2016-05-16 366 81 NaN NaN
#> 8 2016-05-17 1503 92 NaN NaN
Created on 2021-11-24 by the reprex package (v2.0.1)