Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Date time Range Waterconsumption
- 1/1/01 0300 31km 2.0liters
- 2/1/01 0800 30km 1.8liters
- 3/1/01 0300 33km 1.7liters
- 4/1/01 0600 32km 1.8liters
- 5/1/01 0800 28km 1.7liters
- 6/1/01 0300 35km 1.6liters
- 7/1/01 0800 31km 1.8liters
- Date time heatlost weight
- 1/1/01 0300 0.27 61.5kg
- 2/1/01 0800 0.33 62.0kg
- 5/1/01 0800 0.69 61.7kg
- 6/1/01 0300 0.15 61.8kg
- 7/1/01 0800 0.63 62.0kg
- set.seed(10)
- df1 <-
- data.frame(
- id = c(1:4),
- time = c(1:4),
- range = runif(4,0,1),
- watercon = runif(4,5,6)
- )
- df2 <-
- data.frame(
- id = c(1,4),
- time = c(1,4),
- heatlost = c(11,7),
- weight = c(10,10)
- )
- dplyr::left_join(df1, df2, "time")
- 1 0.5074782 5.085136 1 11 10
- 2 0.3067685 5.225437 NA NA NA
- 3 0.4269077 5.274531 NA NA NA
- 4 0.6931021 5.272305 4 7 10
Add Comment
Please, Sign In to add comment