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)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.