How to join two data object in one data frame in R?

Viewed 58

I am trying to join two data objects: Death and Disability. Inside of the object is time, mean value and CI for each time point.

Death <- data.frame(t=time, Diff_de_mean, Diff_de_list_ci_mean)
 
Disability <- data.frame(t=time, Diff_dis_mean, Diff_dis_list_ci_mean)`

When I use function "full_join" df <- full_joint(Death, Disability)

I get a table only with missing (NA) values for the mean value of the Disability variable but I get the CI for this value. The question is, how should I join these two objects that I get also mean value?

Thank you! Showed in the figure

I tried full_join function

1 Answers

Without knowing your two dataframes, I suggest the following code should work based on the image you showed:

library(dplyr)
df <- left_join(Death, Disability, by = "time")

This will join the two data frames based on the time.

Related