Skip to content

Commit

Permalink
fixing curly braces
Browse files Browse the repository at this point in the history
  • Loading branch information
philipdelff committed Oct 19, 2023
1 parent acdc800 commit 20575b1
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 21 deletions.
8 changes: 4 additions & 4 deletions R/NMcheckData.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
##'
##' \item col.time (TIME) must be non-negative
##'
##' \item EVID must be in {0,1,2,3,4}.
##' \item EVID must be in \{0,1,2,3,4\}.
##'
##' \item CMT must be positive integers. However, can be missing or zero for EVID==3.
##'
Expand All @@ -123,7 +123,7 @@
##'
##' \item DV must be numeric
##'
##' \item DV must be missing for EVID in {1,4}.
##' \item DV must be missing for EVID in \{1,4\}.
##'
##' \item If found, RATE must be a numeric, equaling -2 or non-negative for dosing events.
##'
Expand All @@ -141,9 +141,9 @@
##' error. Use a second ID column if you deliberately want to
##' soften this check)
##'
##' \item TIME cannot be decreasing within ID, unless EVID in {3,4}.
##' \item TIME cannot be decreasing within ID, unless EVID in \{3,4\}.
##'
##' \item all ID's must have doses (EVID in {1,4})
##' \item all ID's must have doses (EVID in \{1,4\})
##'
##' \item all ID's must have observations (EVID==0)
##'
Expand Down
2 changes: 1 addition & 1 deletion R/NMorderColumns.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
##' following steps, each step depending on corresponding
##' argument.
##'
##' \itemize{
##' \describe{
##' \item{"col.row - "}{Row id if argument row is non-NULL}
##' \item{"not editable - "}{ID (if a column is called ID)}
##' \item{"col.nomtime - "}{Nominal time.}
Expand Down
2 changes: 1 addition & 1 deletion R/NMreadCsv.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
##' format is used, the extension can very well be different from
##' "csv" (say file name is
##' "input.tab")". This will work for any delimited format supported by fread.
##' @param args.fst Optional arguments to pass to \code{read_fst} if code{format="fst"} is used.
##' @param args.fst Optional arguments to pass to \code{read_fst} if \code{format="fst"} is used.
##' @details This is almost just a shortcut to fread so you don't have to remember how to read the data that was exported for Nonmem. The only added feature is that meta data as written by NMwriteData is read and attached as NMdata metadata before data is returned.
##' @return A data set of class as defined by as.fun.
##' @importFrom data.table fread
Expand Down
5 changes: 3 additions & 2 deletions R/NMscanData.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
##' \item{Read and combine output tables,}
##' \item{If wanted, read input data and restore variables that were not output from the Nonmem model}
##' \item{If wanted, also restore rows from input data that were disregarded in
##' Nonmem (e.g. observations or subjects that are not part of the analysis)}
##' Nonmem (e.g. observations or subjects that are not part of the analysis)
##' }
##' }
##'
##' @param file Path to a Nonmem control stream or output file from
Expand Down Expand Up @@ -293,7 +294,7 @@ NMscanData <- function(file, col.row, use.input, merge.by.row,
## For now, searching for a row identifier is disabled. This may belong in a separate function.
search.col.row <- FALSE
### notice, this can't be evaluated if merge.by.row=="ifAvailable"
if(is.null(merge.by.row.arg) && is.character(merge.by.row) && merge.by.row=="ifAvailable"){
if(!quiet && is.null(merge.by.row.arg) && is.character(merge.by.row) && merge.by.row=="ifAvailable"){
search.col.row <- TRUE
}

Expand Down
8 changes: 4 additions & 4 deletions man/NMcheckData.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/NMorderColumns.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/NMreadCsv.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/NMscanData.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed tests/testthat/testReference/NMscanData1_bu.rds
Binary file not shown.
Binary file removed tests/testthat/testReference/NMscanData21.rds
Binary file not shown.
Binary file added tests/testthat/testReference/NMscanData_21.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMscanData_22b.rds
Binary file not shown.
Binary file removed tests/testthat/testReference/NMscanMultiple1.rds
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/testthat/test_NMscanData.R
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ test_that("Modifying row identifier",{

test_that("merge.by.row=ifAvailable when available",{
NMdataConf(reset=TRUE)
fileRef <- "testReference/NMscanData21.rds"
fileRef <- "testReference/NMscanData_21.rds"

file.lst <- system.file("examples/nonmem/xgxr001.lst" ,package="NMdata")

Expand Down
18 changes: 13 additions & 5 deletions tests/testthat/test_NMscanMultiple.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,25 @@ fix.time <- function(x){
invisible(x)
}



NMdataConf(reset=TRUE)
test_that("basic",{

fileRef <- "testReference/NMscanMultiple1.rds"
fileRef <- "testReference/NMscanMultiple_01.rds"
resRef <- if(file.exists(fileRef)) readRDS(fileRef) else NULL

res <- NMscanMultiple(dir=system.file("examples/nonmem",package="NMdata"),file.pattern="xgxr.*\\.lst", check.time = FALSE,quiet=TRUE)

### we do this in two steps because not all systems will find the files in same order apparently
lsts <- list.files(path="testData/nonmem/",pattern="xgxr00[1-9]\\.lst",full.names=TRUE)
lsts <- sort(lsts)
res <- NMscanMultiple(lsts, check.time = FALSE,quiet=TRUE)
## dim(res)

res <- lapply(res,fix.time)

## res <- lapply(res,fix.time)
res <- as.data.frame(res)
unNMdata(res)
## res[,.N,by=.(model)]

expect_equal_to_reference(res,fileRef,version=2)
## without meta
## expect_equal(unNMdata(res1),unNMdata(readRDS(fileRef)))
Expand Down

0 comments on commit 20575b1

Please sign in to comment.