I'm using the dplyrs
function left_join
to combine two data.frames.
Now I would like to manually join them by using the rownames
in the left data.frame and the appropriate column name in the right data.frame of left_join
, but I get the error:
Error: unexpected '=' in "dplyr::left_join(x.tsummary, sto.info, by = c(rownames(x.tsummary) ="
My code
> dplyr::left_join(x.tsummary, sto.info, by = c(rownames(x.tsummary) = 'Symbol'))
Is this even possible? In the documentation it says that I should specify column names, but it would be great if I could join on rownames for the left data.frame.
Does this help?
dplyr
now recommends to usetibble::rownames_to_column
(dplyr
also has a functionadd_rownames
, which is deprecated in favor oftibble::rownames_to_column
). For example: