You can do it with tidyr by spreading your site to columns and then getting what you need:
library(tidyverse)
df <- tibble::tribble(
~date, ~site, ~number,
"2018-02-28", "A", 16,
"2018-02-28", "B", 22
)
df %>%
tidyr::spread(key = site, value = number) %>%
dplyr::mutate(diff = B - A)
# A tibble: 1 x 4
date A B diff
<chr> <dbl> <dbl> <dbl>
1 2018-02-28 16.0 22.0 6.00