[Stable]

Attempts to remove a parameter from the NONMEM control assuming it has been written according to NMproject conventions (i.e. TVPARAM notation and TVPARAM + IIV_PARAM comments in $THETA/$OMEGA). The presence of any code that depends on the removed parameter will cause the control file to break.

remove_parameter(m, name)

Arguments

m

An nm object.

name

Character. Parameter name to remove.

Value

An nm object with modified ctl_contents field.

Examples


# create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1", 
             based_on = file.path(exdir, "Models", "ADVAN2.mod"),
             data_path = file.path(exdir, "SourceData", "THEOPP.csv"))
             
m1 <- m1 %>% remove_parameter("KA")

nm_diff(m1)
#> < old_ctl                                                                       
#> > new_ctl                                                                       
#> @@ 23,13 / 23,13 @@                                                             
#>                                                                                 
#>   $INPUT ...                                                                    
#> < $DATA ... IGNORE=@                                                            
#> > $DATA ../../../../../../../../../../Users/runner/work/_temp/Library/NMproject/
#> : extdata/examples/theopp/SourceData/THEOPP.csv IGNORE=@                        
#>   $SUB ADVAN2                                                                   
#>                                                                                 
#>   $PK                                                                           
#>                                                                                 
#> < TVKA=EXP(THETA(1))                                                            
#> < MU_1=LOG(TVKA)                                                                
#> < KA = EXP(MU_1+ETA(1))                                                         
#> >                                                                               
#> >                                                                               
#>                                                                                 
#> >                                                                               
#>   TVK=EXP(THETA(2))                                                             
#>   MU_2=LOG(TVK)                                                                 
#> @@ 54,10 / 54,10 @@                                                             
#>                                                                                 
#>   $THETA                                                                        
#> < .....           ; KA ; h-1 ; LOG                                              
#> >                                                                               
#>   .....           ; K  ; h-1 ; LOG                                              
#>   .....           ; V  ; L ; LOG                                                
#>                                                                                 
#>   $OMEGA                                                                        
#> < 0.1                               ; IIV_KA ; LOG                              
#> >                                                                               
#>   0.1                               ; IIV_K ; LOG                               
#>   0.1                               ; IIV_V ; LOG