So I'm trying to merge the following two datasets:
> dput(head(org_avg_long))
structure(list(Sample = c("Initial Biomass", "Initial Biomass",
"Initial Biomass", "Initial Biomass", "Initial Biomass", "Initial Biomass"
), Acid = c("Succinic acid", "Lactic acid", "Formic acid", "Acetic acid",
"Propionic acid", "Isobutyric acid"), avg = c("12.3", "0.2",
"0.0", "2.2", "0.1", "0.0")), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"))
> dput(head(org_sd_long))
structure(list(Sample = c("Initial Biomass", "Initial Biomass",
"Initial Biomass", "Initial Biomass", "Initial Biomass", "Initial Biomass"
), Acid = c("Succinic acid", "Lactic acid", "Formic acid", "Acetic acid",
"Propionic acid", "Isobutyric acid"), sd = c("0.0", "0.0", "0.0",
"0.5", "0.0", "0.0")), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"))
But when I use the merge function, it's telling me that my columns don't exist:
> org_acid_2<-merge(org_avg_long,org_sd_long,by=c(Sample,Acid))
Error in fix.by(by.x, x) : object 'Sample' not found
>
I'm not sure why it isn't finding my columns that exist. Any input would be greatly appreciated.