Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarkEdmondson1234/0538fb6ac24a1dc6e6a8c123ff073cb4 to your computer and use it in GitHub Desktop.
Save MarkEdmondson1234/0538fb6ac24a1dc6e6a8c123ff073cb4 to your computer and use it in GitHub Desktop.
library("RSiteCatalyst")
library("dplyr")
SCAuth("peter.meyer@xxx.com:xxx", "xxx")
reportSuites <- GetReportSuites()
evar <- GetEvars(reportSuites$rsid) #%>%
# reportSuite <- reportSuites$rsid
props <- GetProps(reportSuites$rsid)
rsids <- reportSuites$rsid
list_of_dfs <- lapply(rsids, function(x){
print(x)
GetEvars(x)
})
# name the list the rdids
named_list_of_dfs <- setNames(list_of_dfs, rsids)
## access the dfs
name1 <- rsids[[1]]
named_list_of_dfs[[name1]]
# or if you know the name of rsid:
named_list_of_dfs$rsid_name
# then maybe you want to put all the evars in one data.frame
# alter named list of df,s to add the rsid name to a column
add_rsid_column <- lapply(names(named_list_of_dfs), function(x){
o <- named_list_of_dfs[[x]]
o$rsid_name <- x
o
})
# make one df
all_evars <- Reduce(rbind, add_rsid_column)
all_evars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment