Skip to content

Commit e13166d

Browse files
author
Kenneth Daily
authored
Merge pull request #14 from Sage-Bionetworks/develop
Develop
2 parents d474e7a + 898c961 commit e13166d

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

inst/report.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ tmp <- queryData %>%
212212
dplyr::count(id, NAME, NODE_TYPE) %>%
213213
dplyr::filter(n >= 5, !stringr::str_detect(id, "acl"))
214214
215+
if (nrow(tmp) > 0) {
215216
dataaccessCount1 <- queryData %>%
216217
dplyr::filter(recordType == 'download') %>%
217218
dplyr::filter(id %in% tmp$id) %>%
@@ -236,4 +237,5 @@ dataaccessCount <- dataaccessCount1 %>% left_join(dataaccessCount2, by=c("id", "
236237
dplyr::select(name, everything(), total, -id, -NAME)
237238
238239
dataaccessCount %>% DT::datatable(options=list(pageLength=20), escape=1)
240+
}
239241
```

inst/scripts/manual_AMPAD.R

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1+
library(synapseClient)
2+
synapseLogin()
3+
14
templates <- c("webAccess"="../webAccess.Rmd",
25
"downloads"="../downloads.Rmd",
36
"report"="../report.Rmd")
47

58
### AMP-AD
69
projectId <- 'syn2580853'
7-
reportType <- "webAccess"
10+
reportType <- "report"
11+
12+
# Store HTML file here
13+
parentId <- 'syn8457451'
814

915
myParams <- list(projectId=projectId,
10-
nMonths=26,
16+
nMonths=30,
1117
aclTeamOrder=c(3346847, 3320424, projectId),
1218
useTeamGrouping=TRUE)
1319

14-
reportType <- "report"
20+
htmlFileName <- paste0(myParams[['projectId']], "_", reportType, "_",
21+
lubridate::today(), ".html")
22+
1523
rmarkdown::render(input=templates[[reportType]],
16-
output_file=paste0(myParams[['projectId']], "_", reportType, "_",
17-
lubridate::today(), ".html"),
24+
output_file=htmlFileName,
1825
params = myParams)
26+
27+
htmlFile <- synStore(File(paste0("../", htmlFileName), parentId=parentId))

0 commit comments

Comments
 (0)