Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. ```{r}
  2. #variables <- which(grepl("yt", "ab", "bc", "dc", "ma", "mo", "mt", "nb", "nf", "ns", "nt", "on", "pe", "pq", "qc", "sa", "sk", "yk", "ty", ufo_dfus$state))
  3. #variables
  4.  
  5. variables <- which(grepl("yt", "ab", "bc", ufo_dfus$state))
  6.  
  7. variables <- which(grepl("dc", "ma", "mo", ufo_dfus$state))
  8.  
  9. variables <- which(grepl("nb", "nf", "ns", ufo_dfus$state))
  10.  
  11. variables <- which(grepl("nt", "on", "pe", ufo_dfus$state))
  12.  
  13. variables <- which(grepl("pq", "qc", "sa", ufo_dfus$state))
  14.  
  15. variables <- which(grepl("sk", "yk", "ty", ufo_dfus$state))
  16.  
  17. variables <- which(grepl("mt", ufo_dfus$state))
  18.  
  19. ufo_dfus[-row_number(variables)]
  20.  
  21. table(ufo_dfus$state)
  22. #AB, yk, yt, nt,
  23. # AB BC DC MA MO MT NB NF NS NT ON PE PQ QC SA SK YK TY
  24. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement