Hi all,
I am not an expert and I need some help to solve a problem. I have two tables where the rows are molecules measured in blood and the columns are the different patients. The patients are totally different between the two tables, whereas the rows are mostly commons. How can I create a single table that combines the common molecules, maintaining the different ones?
There must be multiple solutions to this, but as we are in the RStudio forums, I think using the dplyr package is the way to go!
dplyr has many useful *_join functions that you can use to merge data frames by matching the values of one or more columns. In this case, full_join is the way to go, as it keeps all the molecules that appear in either of the two data frames.
Thank you for your reply. Unfortunately, I have these error messages:
Joining, by = "Molecole"
Errore: Argument 1 is of unsupported type data.frame
Inoltre: Warning message:
Column Molecole joining factors with different levels, coercing to character vector
I'm so sorry about the error, I made a mistake when copying the code here. The last line should be arrange(Molecole), not arrange(merged, molecole). I edited my first reply to correct it!
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: