Guest User

Untitled

a guest
Oct 17th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. data1 <- tibble(person = c("A","B","C"),
  2. test1 = as.factor(c(1,4,5)),
  3. test2 = c(14,25,10),
  4. test3 = c(12.5,16.0,4),
  5. test4 = c(16,23,21),
  6. test5 = as.factor(c(49,36,52)))
  7.  
  8. data2 <- tibble(person = c("D","E","F"),
  9. test1 = c(8,7,2),
  10. test3 = c(6.5,12.0,19.5),
  11. test4 = as.factor(c(15,21,29)),
  12. test5 = as.factor(c(54,51,36)),
  13. test6 = c(32,32,29),
  14. test7 = c(13,11,10))
  15.  
  16. all_data <- dplyr::bind_rows(data1,data2)
  17.  
  18. # A tibble: 6 x 8
  19. person test1 test2 test3 test4 test5 test6 test7
  20. <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
  21. 1 A 1 14 12.5 16 49 NA NA
  22. 2 B 4 25 16.0 23 36 NA NA
  23. 3 C 5 10 4.0 21 52 NA NA
  24. 4 D 8 NA 6.5 15 54 32 13
  25. 5 E 7 NA 12.0 21 51 32 11
  26. 6 F 2 NA 19.5 29 36 29 10
  27.  
  28. Error in bind_rows_(x, .id) : Column `test1` can't be converted from factor to numeric
Add Comment
Please, Sign In to add comment