I have two dataframes that I need to merge. Each dataframe contains a column or row where the first 30 or so characters are similar but the characters after are different. However, the first 30 characters for each row are different throughout, they are sample names for some data so I don't have a preset partial string I can match with.
reproducible df example:
df1<-data.frame(1:4) rownames(df1)<-c('hello5678', 'how6543', 'are9863', 'you5364') df2<-data.frame(1:4) rownames(df2)<-c('hello1234', 'how7643', 'are6323', 'you7496')
as you can see the first set of characters or words are common but the following numbers are different - I have 1000's of samples, so it is not feasible to make them the same one by one. I have looked everywhere but cannot find a way of merging these dataframes together based on rownames (in this reproducible example) or if they were columns.. i am trying to achieve the same thing.
Any help is appreciated. thank you.