| NEWS | R Documentation |
News for Package nmw
Version 0.5.1 (2026-08-21)
nmw_report_resid()now omits unavailable residual diagnostics cleanly whensdtablacksWRES,CWRES, orIWRE, or when such a column contains no finite values. Binomial tests, extreme-value tables, distribution plots, and subject plots are generated only for usable residuals; missing panels contain an explanatory placeholder rather than failing on non-finite plot limits.Diagnostic report functions now document their invisible summary return values. The
modelargument documentation fornmw_report_output()andnmw_report_indipk()now states that it is accepted only for a uniform report API because those reports read the fixed files ‘PRINT.OUT’ and ‘patab’.The minimum simPDF version is now 0.1.1, the first CRAN release, and the minimum R version is aligned with simPDF at 3.6.0.
Regression tests now exercise PDF generation and the missing
IWREcase using the bundled NONMEM example.
Version 0.5.0 (2026-07-11)
The eight diagnostic report functions (
nmw_report_ofv,nmw_report_param,nmw_report_pred,nmw_report_resid,nmw_report_ebe,nmw_report_input,nmw_report_output,nmw_report_indipk) are re-implemented on the simPDF report engine (now inImports). The statistics/parsing is unchanged; the former dead-reckonedpdf()+PrinTxt/split.screenlayout is replaced by a measured flowing layout, which eliminates the text/matrix overlap that appeared inS2-Parameters.PDFfor models with many random effects (validated overlap-free across hundreds of real runs, up to 14ETAs). Each report gainedfileandmodelarguments (backward compatible).nmw_report_predno longer errors on subjects/compartments with no observation records (the "zero-length labels" crash);nmw_report_residtolerates ansdtabthat is missing a residual column (e.g.IWRE).The low-level layout helpers
PrepPDF,PrinTxt,AddPage,PrinMTxtandClosePDFare removed (superseded by simPDF);DxPlotPostis retained.
Version 0.4.0 (2026-07-08)
New function
ctl2nmw(): reads a closed-form$PREDNONMEM control stream and auto-generates thePREDfunction (with itsderiv()companions) and the initial estimates (THETAinit,OMinit,SGinit,LB,UB,METHOD) needed byInitStep(). This removes the main inconvenience of the package: hand-writing thePREDfunction. The generatedPREDreproduces the hand-written examplePREDnumerically (verified to floating-point tolerance forFO,FOCE-INTERandLaplaceon the bundled THEO control streams).The generator classifies free symbols over both the structural model
Fand the error modelY, so aTHETAor data item that appears only in the residual error (e.g. a combined additive-plus-proportionalWterm) is wired intoHcorrectly. Random-effect subscripts are ordered numerically (soETA10followsETA9), and$PREDETA/EPSindices are cross-checked against$OMEGA/$SIGMA.Out-of-scope control streams fail with an informative message rather than generating incorrect code: ODE models (
$PK/$DES/$SUBROUTINE/ADVAN),IF/THENbranching, MU-referencing, mixtures, unsupported estimation methods, andFIXed parameters. Assigning the same symbol more than once in$PRED(sequential reassignment) or referencing a symbol before it is defined is likewise rejected, as is a$THETAinitial estimate on or outside its bounds (InitStep()scaling needsLB < init < UB). A diagonal$OMEGAis promoted to a full block, a non-diagonal$SIGMAis reduced to its diagonal, and an unbounded$THETAwith a non-positive initial estimate getsLB = -1e6instead of the usual default0, each with a note.The environment
eis exported again. It had been exported up to 0.1.6 viaexportPattern()and was inadvertently dropped in 0.2.0's switch to explicit exports. Without it, a user-writtenPREDfunction referencinge$METHOD– the documented workflow, and also the code thatctl2nmw()generates – stopped with “object 'e' not found” whenEstStep()ran it, and reading results withget("EBE", envir=e)failed likewise.Internal refactoring (prepared as an unreleased 0.3.2) is included in this release. It changes no other public API and no numerical result of the estimation steps (
FO,FOCE-INTER,Laplace) or of any diagnostic report; verified by comparing the estimation output and all eight report PDFs against the pre-refactor sources on the bundled example run.De-duplication: the covariate-classification block repeated three times inside
report_ebeis now the internal helperClassifyCovariates(); the shared record-count extraction isGetNRecFromXML();NMVarStat()reuses theAllNA()/AllSame()helpers.Bug fix: the “Sigmas” section of
nmw_report_param(S2-Parameters) no longer errors for models with two or moreSIGMAelements (e.g. a combined additive-plus-proportional error model); a test that mixed&&and&produced a condition of length greater than one.Bug fix:
PanelCor()no longer errors when an explicitcex.corvalue is supplied (an undefinedcexwas referenced).InitStep(): the documentedLB/UBdefaults (0and1e6) are now applied before they are used, so omitting these arguments works as documented instead of raising an error. PassingLB/UBexplicitly behaves exactly as before.Loop bounds in the data-handling utilities (
AddDoNoTaLD,ExpandDoseHist,RemoveNA,RmvFixed,RmvZero,RenCol) and in the shared report helpers now useseq_len()/seq_along()so they no longer misbehave on zero-row input.Housekeeping: removed leftover working files and dead commented code from
R/, replacedT/Fliterals withTRUE/FALSE, corrected user-visible typos in report titles and labels (“Individiual”, “Estitmate”, “Recods”), and corrected theTrimOut()return-value documentation.
Version 0.3.1 (2026-06-09)
SumOut()bug fix: the lineRunFolders <- MatchEnd(Folders, RunExt)previously assigned the logical vector returned byMatchEnd()toRunFoldersinstead of using it as a mask to subsetFolders. This causedstrsplit()insideGetModelNames()to fail with "non-character argument" whenever any run folders were present. NowRunFolders <- Folders[MatchEnd(Folders, RunExt)].SumOut()defaultRunExtchanged from".R75"to".R76"to match NONMEM 7.6 (the current production release). Users on NONMEM 7.5 should passRunExt = ".R75"explicitly.SumOut()now warns and returnsinvisible(NULL)when no matching run folders are found, instead of erroring on a zero-length loop.GetProbVal()bug fix:grep(Tag, PROB)returnsinteger(0)when the requested tag (e.g."P:"or"F:") is absent – for example when the$PROBrecord is longer than 80 characters and NM-TRAN truncates it inside theFCONfile, dropping the tag. The previousif (Loc > 0)test raised "argument is of length zero". The test was changed toif (length(Loc) > 0 && Loc[1] > 0), returning an empty string when the tag is absent.man/SumOut.Rdupdated to reflect the new defaultRunExtand a richer description of the return value.MatchEnd()bug fix: replacedfor (i in 1:n)withfor (i in seq_len(n))so that calling on an empty character vector no longer iterates overc(1, 0)and tries to readNAelements.Regression tests added in
tests/testthat/test-utils_data.Rcovering theSumOut()empty-folder,GetProbVal()missing-tag, andMatchEnd()empty-input cases.report_ebe()(S5 “ETA vs Categorical Variables”) bug fix: when the number of ETAs times the number of categorical covariates produced a panel grid too dense for boxplot margins,plot.new()raised “figure margins too large” and the PDF was truncated mid-page. The categorical-covariate panels are now split across multiple PDF pages (cap of ~35 panels per page, configurable through the internalMAX_CELLS_PER_PAGEconstant), with page numbers appended to the panel title when more than one page is produced.
Version 0.3.0 (2026-05-08)
General-purpose helpers for NONMEM dataset construction added (
build_nm_dataset,build_dose_records,build_obs_records).Time-varying covariate merge by LOCF/LOCB:
locf_value,merge_cov_locf.Datetime parsers:
parse_dtc,dat2_time_to_posix.Coding helpers:
code_sex,code_race.Cockcroft-Gault CRCL:
crcl_cg,add_crcl_cg.Mass to molar unit conversion:
nm_to_molar.
Version 0.2.0 (2026-03-08)
Post-run processing of NONMEM output with PDF diagnostic reports merged from nma package.
8 report types: OFV, Parameters, Predictions, Residuals, EBE, Input, Output, IndiPK.
New utility functions for NONMEM data processing and parsing.
Switched from exportPattern to explicit exports in NAMESPACE.
Version 0.1.6 (2026-03-08)
Typos in documentation corrected.
Version 0.1.5 (2023-05-09)
AddCox function for adding a covariate to existing NONMEM dataset.
CombDmExPc function for combining demographics(DM), dosing(EX), and DV(PC) tables.
TrimOut function to beautify the original NONMEM OUTPUT
Errata in manual corrected.
Version 0.1.4 (2018-04-10)
Errata in manual corrected.
Version 0.1.3 (2017-10-23)
TabStep()is added.Speed is increased.
References are updated.
Vignette is updated.
Version 0.1.2 (2017-10-20)
This package will be used at the workshop on 2017-10-25 at Kyoto Japan 1st APC satellite workshop.
Bug at calculating objective function value for "LAPL" method is fixed.
Bug at scaling other than zero lower bound transformation fixed.
Version 0.1.1 (2017-03-14)
This package will be used at the workshop within US FDA on 2017-03-21.
For the initialization step,
Predfunction name should be given by the user. It does not read directly from the file any more.
Version 0.1.0 (2017-02-21)
This package was born and used at the Workshop held by Kyun-Seop Bae MD PhD <k@acr.kr>.
InitStepusedPredfunction within a file.