Skip to content

Commit 09e9f66

Browse files
committed
cleaning tests. quiet flagsCount.
1 parent b0ebc78 commit 09e9f66

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

R/flagsCount.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
##' be written if file argument is supplied.
4141
##' @param flagc.0 The character flag to assign to rows that are not
4242
##' matched by exclusion conditions (numerical flag 0).
43+
##' @param quiet Suppress non-critical messages? Default is `FALSE`.
4344
##' @param as.fun The default is to return a data.table if input data
4445
##' is a data.table, and return a data.frame for all other input
4546
##' classes. Pass a function in as.fun to convert to something
@@ -88,7 +89,9 @@ flagsCount <- function(data,tab.flags,file,col.id="ID",
8889
by=NULL, flags.increasing=FALSE,
8990
flagc.0="Analysis set",
9091
name.all.data="All available data",
91-
grp.incomp="EVID",save=TRUE,as.fun=NULL){
92+
grp.incomp="EVID",save=TRUE,
93+
quiet=FALSE,
94+
as.fun=NULL){
9295

9396
#### Section start: Dummy variables, only not to get NOTE's in package checks ####
9497

@@ -293,7 +296,7 @@ flagsCount <- function(data,tab.flags,file,col.id="ID",
293296

294297
if(!is.null(file)&&save){
295298
fwrite(allres,file=file,quote=FALSE,row.names=F)
296-
cat(paste0("Table written to ",file,"\n"))
299+
if(!quiet) message(paste0("Table written to ",file,"\n"))
297300
}
298301

299302

man/flagsCount.Rd

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-51 Bytes
Binary file not shown.

tests/testthat/test_NMreadInits.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_that("basic",{
66
file.mod <- "testData/nonmem/xgxr032.mod"
77

88
NMdataConf(reset=T)
9-
NMdataConf(as.fun="data.table")
9+
## NMdataConf(as.fun="data.table")
1010

1111
lines <- readLines(file.mod)
1212
res1 <- NMreadInits(lines=lines,return="all")
@@ -31,7 +31,7 @@ test_that("with OMEGA block",{
3131
})
3232

3333
test_that("OMEGA SAME",{
34-
34+
NMdataConf(reset=T)
3535
fileRef <- "testReference/NMreadInits_03.rds"
3636

3737
text <- c("

tests/testthat/test_flags.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ test_that("Writing data - data.frames",{
143143
pk <- flagsAssign(pk,subset.data="EVID==1",flagc.0="Dosing")
144144

145145
## all excluded due to below LLOQ
146-
tab.count <- flagsCount(pk[pk$EVID==0,],dt.flags,flags.increasing=T,file=testOut)
146+
tab.count <- flagsCount(pk[pk$EVID==0,],dt.flags,flags.increasing=T,file=testOut,quiet=TRUE)
147147

148148
testRes <- fread(testOut,header=T)
149149

tests/testthat/test_listMissings.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ test_that("basic",{
55
fileRef <- "testReference/listMissings_1.rds"
66

77
pk <- readRDS(file="testData/data/xgxr2.rds")
8-
miss <- listMissings(pk)
8+
miss <- listMissings(pk,quiet=TRUE)
99

1010
expect_equal_to_reference(miss,fileRef,version=2)
1111

0 commit comments

Comments
 (0)