Guest User

Untitled

a guest
Jan 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. library(synapser)
  2. library(purrr)
  3.  
  4. #' Convenience function to get table as a data frame
  5. #' Will not be needed with a new synapser release
  6. tableQueryAsDf <- function(query) {
  7. synTableQuery(query)$asDataFrame()
  8. }
  9.  
  10. #' get a data frame of rallies from a root project
  11. get_rallies <- function(root_project) {
  12. rallies <- tableQueryAsDf(sprintf('select * from %s', root_project$annotations[["rallyTableId"]][0]))
  13. }
  14.  
  15. #' get a data frame of sprints from a rally project
  16. get_sprints <- function(rally_project) {
  17. rallies <- tableQueryAsDf(sprintf('select * from %s', rally_project$annotations[['sprintTableId']][0]))
  18. }
  19.  
  20. syn <- synLogin(silent=TRUE)
  21. root_project_id <- 'syn11645282'
  22. root_project <- synapser::synGet(root_project_id)
  23.  
  24. rallies <- get_rallies(root_project)
  25.  
  26. sprints <- purrr::map_dfr(rallies$id, function(x) get_sprints(synGet(x)))
  27.  
  28. sprint_wikis <- purrr::map(sprints$id, synGetWiki)
Add Comment
Please, Sign In to add comment