No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
e505ecc
... +4 ...
90fa42c
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
1    # Copyright (C) 2015 Johannes Ranke 

2    # Contact: jranke@unibremen.de 

3    # This file is part of the R package pfm 

4    
5    # This program is free software: you can redistribute it and/or modify it under 

6    # the terms of the GNU General Public License as published by the Free Software 

7    # Foundation, either version 3 of the License, or (at your option) any later 

8    # version. 

9    
10    # This program is distributed in the hope that it will be useful, but WITHOUT 

11    # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 

12    # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 

13    # details. 

14    
15    # You should have received a copy of the GNU General Public License along with 

16    # this program. If not, see <http://www.gnu.org/licenses/> 

17    
18  1  #' Calculate predicted environmental concentrations in surface water due to drift 

19  2  #' 

20  3  #' This is a basic, vectorised form of a simple calculation of a contaminant 
1    # Copyright (C) 2015,2020 Johannes Ranke 

2    # Contact: jranke@unibremen.de 

3    # This file is part of the R package pfm 

4    
5    # This program is free software: you can redistribute it and/or modify it under 

6    # the terms of the GNU General Public License as published by the Free Software 

7    # Foundation, either version 3 of the License, or (at your option) any later 

8    # version. 

9    
10    # This program is distributed in the hope that it will be useful, but WITHOUT 

11    # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 

12    # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 

13    # details. 

14    
15    # You should have received a copy of the GNU General Public License along with 

16    # this program. If not, see <http://www.gnu.org/licenses/> 

17    
18  1  #' Calculate the geometric mean 

19  2  #' 

20  3  #' Based on some posts in a thread on Stackoverflow 
1    # Copyright (C) 2016,2017 Johannes Ranke 

2    
3    # Contact: jranke@unibremen.de 

4    # This file is part of the R package pfm 

5    
6    # This program is free software: you can redistribute it and/or modify it under 

7    # the terms of the GNU General Public License as published by the Free Software 

8    # Foundation, either version 3 of the License, or (at your option) any later 

9    # version. 

10    
11    # This program is distributed in the hope that it will be useful, but WITHOUT 

12    # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 

13    # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 

14    # details. 

15    
16    # You should have received a copy of the GNU General Public License along with 

17    # this program. If not, see <http://www.gnu.org/licenses/> 

18    
19  1  #' Create a time series of decline data 

20  2  #' 

21  3  #' @param x When numeric, this is the halflife to be used for an exponential 

22  4  #' decline. When a character string specifying a parent decline model is given 

23  5  #' e.g. \code{FOMC}, \code{parms} must contain the corresponding parameters. 

24  6  #' If x is an \code{\link{mkinfit}} object, the decline is calculated from this 

25    #' object. 

7  +  #' object. 

26  8  #' @param ini The initial amount. If x is an \code{\link{mkinfit}} object, and 

27  9  #' ini is 'model', the fitted initial concentrations are used. Otherwise, ini 

28  10  #' must be numeric. If it has length one, it is used for the parent and 
93  75  
94  76  t_out < seq(0, t_end, by = res) 

95  77  pred < mkinpredict(m, odeparms = parms, odeini = c(parent = ini), 

96    outtimes = t_out, solution_type = "analytical")[1] 

78  +  outtimes = t_out, solution_type = "analytical")[, 1, drop = FALSE] 

97  79  result < ts(pred, 0, t_end, frequency = 1/res) 

98  80  class(result) < c("one_box", "ts") 

99  81  return(result) 
118  100  else solution_type = "deSolve" 

119  101  
120  102  tmp < mkinpredict(fit$mkinmod, odeparms = fit$bparms.ode, odeini = odeini, 

121    outtimes = t_out, solution_type = solution_type)[1] 

103  +  outtimes = t_out, solution_type = solution_type)[, 1, drop = FALSE] 

122  104  result < ts(tmp, 0, t_end, frequency = 1/res) 

123  105  class(result) < c("one_box", "ts") 

124  106  return(result) 
172  154  
173  155  #' Create decline time series for multiple applications 

174  156  #' 

175    #' If the application pattern is specified in \code{applications}, 

157  +  #' If the application pattern is specified in \code{applications}, 

176  158  #' \code{n} and \code{i} are disregarded. 

177  159  #' @param x A \code{\link{one_box}} object 

178  160  #' @param n The number of applications. If \code{applications} is specified, \code{n} is ignored 
260  242  #' for finding the maximum. It is therefore recommended to check this using 

261  243  #' \code{\link{plot.one_box}} using the window size for the argument 

262  244  #' \code{max_twa}. 

263    #' 

245  +  #' 

264  246  #' The method working directly on fitted \code{\link{mkinfit}} objects uses the 

265  247  #' equations given in the PEC soil section of the FOCUS guidance and is restricted 

266  248  #' SFO, FOMC and DFOP models and to the parent compound 
1    # Copyright (C) 2015 Johannes Ranke 

2    # Contact: jranke@unibremen.de 

3    # This file is part of the R package pfm 

4    
5    # This program is free software: you can redistribute it and/or modify it under 

6    # the terms of the GNU General Public License as published by the Free Software 

7    # Foundation, either version 3 of the License, or (at your option) any later 

8    # version. 

9    
10    # This program is distributed in the hope that it will be useful, but WITHOUT 

11    # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 

12    # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 

13    # details. 

14    
15    # You should have received a copy of the GNU General Public License along with 

16    # this program. If not, see <http://www.gnu.org/licenses/> 

17    
18  1  #' Groundwater ubiquity score based on Gustafson (1989) 

19  2  #' 

20  3  #' The groundwater ubiquity score GUS is calculated according to 
24  7  #' @references Gustafson, David I. (1989) Groundwater ubiquity score: a simple 

25  8  #' method for assessing pesticide leachability. \emph{Environmental 

26  9  #' toxicology and chemistry} \bold{8}(4) 339–57. 

27    #' @inheritParams endpoint 

28  10  #' @param DT50 Halflife of the chemical in soil. Should be a field 

29  11  #' halflife according to Gustafson (1989). However, leaching to the subsoil 

30  12  #' can not completely be excluded in field dissipation experiments and Gustafson 
1    # Copyright (C) 2015 Johannes Ranke 

2    # Contact: jranke@unibremen.de 

3    # This file is part of the R package pfm 

4    
5    # This program is free software: you can redistribute it and/or modify it under 

6    # the terms of the GNU General Public License as published by the Free Software 

7    # Foundation, either version 3 of the License, or (at your option) any later 

8    # version. 

9    
10    # This program is distributed in the hope that it will be useful, but WITHOUT 

11    # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 

12    # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 

13    # details. 

14    
15    # You should have received a copy of the GNU General Public License along with 

16    # this program. If not, see <http://www.gnu.org/licenses/> 

17    
18  1  #' Calculate a time course of relative concentrations based on an mkinmod model 

19  2  #' 

20  3  #' @import mkin 
30  13  #' @author Johannes Ranke 

31  14  #' @examples 

32  15  #' head(pfm_degradation("SFO", DT50 = 10)) 

33    pfm_degradation < function(model = "SFO", DT50 = 1000, parms = c(k_parent_sink = log(2)/DT50), 

34    years = 1, step_days = 1, 

35    times = seq(0, years * 365, by = step_days)) 

16  +  pfm_degradation < function(model = "SFO", 

17  +  DT50 = 1000, parms = c(k_parent = log(2)/DT50), 

18  +  years = 1, step_days = 1, 

19  +  times = seq(0, years * 365, by = step_days)) 

36  20  { 

37  21  if (model %in% c("SFO", "FOMC", "DFOP", "HS", "IORE")) { 

38  22  model < mkinmod(parent = list(type = model)) 

39  23  } 

40  24  initial_state = c(1, rep(0, length(model$diffs)  1)) 

41  25  names(initial_state) < names(model$diffs) 

42  26  time_course < mkinpredict(model, odeparms = parms, 

43    odeini = initial_state, 

44    outtimes = times, 

45    solution_type = ifelse(length(model$spec) == 1, 

46    "analytical", "deSolve")) 

27  +  odeini = initial_state, 

28  +  outtimes = times, 

29  +  solution_type = ifelse(length(model$spec) == 1, "analytical", "deSolve")) 

47  30  invisible(time_course) 

48  31  } 
Learn more Showing 1 files with coverage changes found.
R/TSCF.R
Files  Coverage 

R  ^{ 0.32% } 68.80% 
Project Totals (17 files)  68.80% 
90fa42c
df70d80
512cd50
58c6214
e3bc264
e505ecc