structure(list(UserID = c(42L, 42L, 42L, 95L, 95L, 95L, 95L,
95L), TotalSpend_A = c(NA, NA, NA, NA, 177.12, NA, NA, NA),
TotalSpend_B = c(NA, 40.78, NA, NA, NA, NA, 62.87, NA),
TotalSpend_C = c(NA, NA, 6.74, NA, NA, NA, NA, 96.91), TotalSpend_D = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
NA_real_), TotalSpend_E = c(NA, NA, NA, NA, NA, 1.1, NA,
NA)), .Names = c("UserID", "TotalSpend_A", "TotalSpend_B",
"TotalSpend_C", "TotalSpend_D", "TotalSpend_E"), class = c("data.table",
"data.frame"), row.names = c(NA, -8L))
If I have the following and I want each UserID to have one row and not multiple, how can I combine them?
See Question&Answers more detail:
os