Question: I have two differents dataframes

```
DF1 = data.frame("A"= c("a","a","b","b","c","c"), "B"= c(1,2,3,4,5,6))
DF2 = data.frame("A"=c("a","b","c"), "C"=c(10,11,12))

```

I want to add the column `C` to `DF1` grouping by column `A`  

The expected result is

```
  A B C
1 a 1 10
2 a 2 10
3 b 3 11
4 b 4 11
5 c 5 12
6 c 6 12

```

note: In this example all the groups have the same size but it won't be necessarily the case

Answer: 
Welcome to stackoverflow. As @KarthikS commented, what you want is a join.

'Joining' is the name of the operation for connecting two tables together. 'Grouping by' a column is mainly used when summarizing a table: For example, group by state and sum number of votes would give the total number of votes by each state (summing without grouping first would give the grand total number of votes).

The syntax for joins in dplyr is:

```r
output = left_join(df1, df2, by = "shared column")

```

or equivalently

```r
output = df1 %>% left_join(df2, by = "shared column")

```

Key reference [here](https://dplyr.tidyverse.org/reference/join.html).

In your example, the shared column is `"A"`.
We can use `merge` from `base R`

```
merge(DF1, DF2, by = 'A', all.x = TRUE)

```