Skip to content

Commit

Permalink
0.0.13 released
Browse files Browse the repository at this point in the history
  • Loading branch information
philipdelff committed Sep 10, 2022
1 parent d58fa7b commit 4e580a9
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 27 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: NMdata
Type: Package
Title: Preparation, Checking and Post-Processing Data for PK/PD Modeling
Version: 0.0.12.908
Version: 0.0.13
Authors@R: person("Philip", "Delff", email = "[email protected]",
role = c("aut", "cre"))
Maintainer: Philip Delff <[email protected]>
Expand Down
17 changes: 9 additions & 8 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Post 0.0.12
# 0.0.13

## New functions
* NMexpandDoses - Transform repeated dosing events (ADDL/II) to
Expand All @@ -10,15 +10,16 @@
has long been part of NMdata but has not been exported until now.

## New data
A new data set called mad is included. It is based on the
mad_missing_duplicates from the xgxr package. Doses are implemented
using ADDL and II (so only one dosing row per subject). It is included
for testing the new NMexpandDoses and coming addTAD functions.
* A new data set called mad is included. It is based on the
mad_missing_duplicates from the xgxr package. Doses are implemented
using ADDL and II (so only one dosing row per subject). It is
included for testing the new NMexpandDoses and coming addTAD
functions.

## Bugfixes
Non-critical bugfix in mergeCheck dimensions overview printed to
console. One column too many was reported in input and result data. No
implications on results from mergeCheck.
* Non-critical bugfix in mergeCheck dimensions overview printed to
console. One column too many was reported in input and result
data. No implications on results from mergeCheck.

# NMdata 0.0.12

Expand Down
4 changes: 2 additions & 2 deletions R/NMextractText.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
##' "PK", "TABLE", etc. It can also be result sections like
##' "MINIMIZATION".
##' @param char.section The section denoted as a string compatible
##' with regular expressions. "\\$" for sections in .mod files,
##' "0" for results in .lst files.
##' with regular expressions. "$" (remember to escape properly)
##' for sections in .mod files, "0" for results in .lst files.
##' @param char.end A regular expression to capture the end of the
##' section. The default is to look for the next occurrence of
##' char.section.
Expand Down
20 changes: 13 additions & 7 deletions R/addTAPD.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,30 @@
##' subjects. Typically if using nominal time, it may be important
##' to specify whether samples at dosing times are pre-dose
##' samples. The default is c(3,0,4,1,2) - i.e. samples and
##' simulations are pre-dose.
##' simulations are pre-dose. See details.
##' @param by Columns to do calculations within. Default is ID.
##' @param as.fun The default is to return data as a data.frame. Pass
##' a function (say tibble::as_tibble) in as.fun to convert to
##' something else. If data.tables are wanted, use
##' as.fun="data.table". The default can be configured using
##' NMdataConf.
##' @details addTAPD does not require the data to be ordered, and it
##' will not order it. This means you can run addTAPD before
##' ordering data (which may be one of the final steps) in data
##' set prepation. The argument called order.evid is important
##' because of this. If a dosing event and a sample occur at the
##' same time, when which dose was the previous for that sample?
##' Default is to assume the sample is a pre-dose sample, and
##' hence output will be calculated in relation to the dose
##' before. If no dose event is found before, NA's will be
##' assigned.
##' @import data.table
##' @export
##' @family DataCreate


addTAPD <- function(data,col.time="TIME",col.evid="EVID",col.amt="AMT",col.tpdos="TPDOS",col.tapd="TAPD",col.ndoses="NDOSES",col.pdosamt="PDOSAMT",col.doscuma="DOSCUMA",subset.dos,subset.is.complete,order.evid = c(3,0,2,4,1),by="ID",as.fun){

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

### Section end: Dummy variables, only not to get NOTE's in pacakge checks


if(missing(as.fun)) as.fun <- NULL
as.fun <- NMdataDecideOption("as.fun",as.fun)
Expand Down Expand Up @@ -99,8 +106,7 @@ addTAPD <- function(data,col.time="TIME",col.evid="EVID",col.amt="AMT",col.tpdos
data[,(col.event):=FALSE]
data[eval(parse(text=subset.event)),(col.event):=TRUE]

### quit if no doses found etc


## expand doses if necessary
data2 <- NMexpandDoses(data=data,col.id=by,quiet=TRUE,as.fun="data.table",col.time=col.time,col.evid=col.evid)

Expand Down
3 changes: 1 addition & 2 deletions devel/scripts/dsCreate_2_MAD.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ ggIndProfs(mad.all.exp,amt="AMT")

mad.all <- NMorderColumns(mad.all)

NMwriteData(mad.all,file="~/wdirs/NMdata/inst/examples/data/mad.rds",write.csv=FALSE,write.rds=TRUE)
NMwriteData(mad.all,file="~/wdirs/NMdata/inst/examples/data/mad.rds",write.csv=FALSE,write.rds=TRUE,args.rds=list(version=2))
file.copy("~/wdirs/NMdata/inst/examples/data/mad.rds","~/wdirs/NMdata/tests/testthat/testData/data",overwrite=T)

9 changes: 6 additions & 3 deletions devel/todo.org
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,20 @@ With load_all():
Risk now is that arguments are set to NULL
Export to parent. Not sure check allows though...
** Function improvements
*** addTAPD
**** TODO Quit if no doses found etc
*** cl
*** dims
**** DONE Check if objects are data.frames
*** DONE fnAppend
**** TODO Support strings without extensions
Example: fnAppend("run",".lst")
**** TODO Make internal in tracee
fnAppend("run",".lst",sep="")
**** DONE Make internal in tracee
*** NMcheckColNames
**** return input column names and Nonmem interpretation for user to spot errors
**** Bad name, what could we call it?
*** cc - create character vector function
*** cc - create character vector function*
*** NMgenText
**** TODO Handle until values not matching column names
**** DONE Add a until argument to specify the last column to use in nonmem
Expand Down Expand Up @@ -114,7 +117,7 @@ Error if not convertible and not NA or ""? "b" should be an error right?
*** TODO [#B] NMcreateDoses Generate dosing schedule with loading, ADDL etc :newFunction:
This is available as a suitcase function
*** TODO [#B] Function for complex dosing regimens :newFunction:
*** TODO [#B] Function to unfold ADDL/II doses to multiple rows :newFunction:
*** DONE [#B] Function to unfold ADDL/II doses to multiple rows :newFunction:
*** mergeCheck
**** TODO [#B] Implement a faster method?
What if we just check for matches in by columns?
Expand Down
Binary file modified inst/examples/data/mad.rds
Binary file not shown.
4 changes: 2 additions & 2 deletions man/NMextractText.Rd

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

1 change: 1 addition & 0 deletions man/NMorderColumns.Rd

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

1 change: 1 addition & 0 deletions man/NMstamp.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/NMwriteSection.Rd

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

26 changes: 25 additions & 1 deletion man/addTAPD.Rd

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

1 change: 1 addition & 0 deletions man/findCovs.Rd

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

1 change: 1 addition & 0 deletions man/findVars.Rd

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

1 change: 1 addition & 0 deletions man/flagsAssign.Rd

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

1 change: 1 addition & 0 deletions man/flagsCount.Rd

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

1 change: 1 addition & 0 deletions man/mergeCheck.Rd

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

1 change: 1 addition & 0 deletions man/tmpcol.Rd

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

Binary file modified tests/testthat/testData/data/mad.rds
Binary file not shown.

0 comments on commit 4e580a9

Please sign in to comment.