I want to perform a join on two tables after a group\_by operation.

```
A <- data.frame(x1=c("a","b","c","d"))
B <- data.frame(x1=c("a","c","d","c","a"), x2=c(1,1,1,2,2))

```

The idea is that x2 is an ID, x1 may be something like a date and there may be other columns for values of temperatures. Table `A` contains all dates and `B` contains actual obervations. I would like to end up with a table with all dates for all IDs with NAs when there is no observation.
The folowwing command generates:

```
> dplyr::left_join(A,B,by="x1")
  x1 x2
1  a  1
2  a  2
3  b NA
4  c  1
5  c  2
6  d  1

```

But I would like something that is more like:

```
x1 x2
a  1
a  2
b NA
b NA
c  1
c  2
d  1
d NA

```

So I tried this without success:

```
B %>% dplyr::group_by(x2) %>% dplyr::left_join(A,.data,by="x1")

```

Keeping the `group_by(x2)` would really come in handy for me if possible