How can I combine two datasets and assign factors to each? I have a very basic question (just starting with R).

I have two datasets (xlsx files) with one variable (x) and 11 observations.

I need to combine these two tables to one table with the variable x (ending up with 22 observations and 1 variable). 

But I still need to be able to distinguish which observations belonged to group1 and which to group2 --> so I guess I have to add a Factor like A for group1 and B for group 2.

How can I add this factor so that it remains with the values after combining/stacking the datasets? 

Thanks already in advance!
Hierarchical indices

Have a look at here (scroll a bit underneath for the code)