ropensci / beautier
Showing 14 of 32 files from the diff.
Newly tracked file
R/is_distr.R changed.
Newly tracked file
R/is_mrca_prior.R changed.
Newly tracked file
R/is_site_model.R changed.
Newly tracked file
R/is_clock_model.R changed.
Newly tracked file
R/is_param.R changed.
Newly tracked file
R/is_distr_name.R changed.
Newly tracked file
R/parameter_to_xml.R changed.
Newly tracked file
R/is_id.R changed.
Newly tracked file
R/is_site_model_name.R changed.

@@ -156,9 +156,9 @@
Loading
156 156
#' is_inv_gamma_distr(create_inv_gamma_distr())
157 157
#' # FALSE
158 158
#' is_inv_gamma_distr(create_laplace_distr())
159 -
#' is_inv_gamma_distr(NA))
160 -
#' is_inv_gamma_distr(NULL))
161 -
#' is_inv_gamma_distr("nonsense"))
159 +
#' is_inv_gamma_distr(NA)
160 +
#' is_inv_gamma_distr(NULL)
161 +
#' is_inv_gamma_distr("nonsense")
162 162
#' @export
163 163
is_inv_gamma_distr <- function(
164 164
  x

@@ -5,7 +5,7 @@
Loading
5 5
#' @author Richèl J.C. Bilderbeek
6 6
#' @examples
7 7
#' # TRUE
8 -
#' is_mrca_prior(create_mrca_prior()))
8 +
#' is_mrca_prior(create_mrca_prior())
9 9
#' # Also 'NA' is a valid MRCA prior,
10 10
#' # denoting that there no MRCA priors
11 11
#' is_mrca_prior(NA)

@@ -38,18 +38,18 @@
Loading
38 38
#' @examples
39 39
#'
40 40
#' # site models
41 -
#' is_gtr_site_model(create_gtr_site_model()))
42 -
#' is_gtr_site_model(create_hky_site_model()))
43 -
#' is_gtr_site_model(create_jc69_site_model()))
44 -
#' is_gtr_site_model(create_tn93_site_model()))
41 +
#' is_gtr_site_model(create_gtr_site_model())
42 +
#' is_gtr_site_model(create_hky_site_model())
43 +
#' is_gtr_site_model(create_jc69_site_model())
44 +
#' is_gtr_site_model(create_tn93_site_model())
45 45
#'
46 46
#' # other models
47 -
#' is_gtr_site_model(NA))
48 -
#' is_gtr_site_model(NULL))
49 -
#' is_gtr_site_model("nonsense"))
50 -
#' is_gtr_site_model(create_strict_clock_model()))
51 -
#' is_gtr_site_model(create_bd_tree_prior()))
52 -
#' is_gtr_site_model(create_mcmc()))
47 +
#' is_gtr_site_model(NA)
48 +
#' is_gtr_site_model(NULL)
49 +
#' is_gtr_site_model("nonsense")
50 +
#' is_gtr_site_model(create_strict_clock_model())
51 +
#' is_gtr_site_model(create_bd_tree_prior())
52 +
#' is_gtr_site_model(create_mcmc())
53 53
#' @export
54 54
is_gtr_site_model <- function(
55 55
  x
@@ -72,18 +72,18 @@
Loading
72 72
#' @examples
73 73
#'
74 74
#' # site models
75 -
#' is_hky_site_model(create_hky_site_model()))
76 -
#' is_hky_site_model(create_gtr_site_model()))
77 -
#' is_hky_site_model(create_jc69_site_model()))
78 -
#' is_hky_site_model(create_tn93_site_model()))
75 +
#' is_hky_site_model(create_hky_site_model())
76 +
#' is_hky_site_model(create_gtr_site_model())
77 +
#' is_hky_site_model(create_jc69_site_model())
78 +
#' is_hky_site_model(create_tn93_site_model())
79 79
#'
80 80
#' # other models
81 -
#' is_hky_site_model(NA))
82 -
#' is_hky_site_model(NULL))
83 -
#' is_hky_site_model("nonsense"))
84 -
#' is_hky_site_model(create_strict_clock_model()))
85 -
#' is_hky_site_model(create_bd_tree_prior()))
86 -
#' is_hky_site_model(create_mcmc()))
81 +
#' is_hky_site_model(NA)
82 +
#' is_hky_site_model(NULL)
83 +
#' is_hky_site_model("nonsense")
84 +
#' is_hky_site_model(create_strict_clock_model())
85 +
#' is_hky_site_model(create_bd_tree_prior())
86 +
#' is_hky_site_model(create_mcmc())
87 87
#' @export
88 88
is_hky_site_model <- function(
89 89
  x
@@ -105,18 +105,18 @@
Loading
105 105
#' @examples
106 106
#'
107 107
#' # site models
108 -
#' is_jc69_site_model(create_gtr_site_model()))
109 -
#' is_jc69_site_model(create_hky_site_model()))
110 -
#' is_jc69_site_model(create_jc69_site_model()))
111 -
#' is_jc69_site_model(create_tn93_site_model()))
108 +
#' is_jc69_site_model(create_gtr_site_model())
109 +
#' is_jc69_site_model(create_hky_site_model())
110 +
#' is_jc69_site_model(create_jc69_site_model())
111 +
#' is_jc69_site_model(create_tn93_site_model())
112 112
#'
113 113
#' # other models
114 -
#' is_jc69_site_model(NA))
115 -
#' is_jc69_site_model(NULL))
116 -
#' is_jc69_site_model("nonsense"))
117 -
#' is_jc69_site_model(create_strict_clock_model()))
118 -
#' is_jc69_site_model(create_bd_tree_prior()))
119 -
#' is_jc69_site_model(create_mcmc()))
114 +
#' is_jc69_site_model(NA)
115 +
#' is_jc69_site_model(NULL)
116 +
#' is_jc69_site_model("nonsense")
117 +
#' is_jc69_site_model(create_strict_clock_model())
118 +
#' is_jc69_site_model(create_bd_tree_prior())
119 +
#' is_jc69_site_model(create_mcmc())
120 120
#' @export
121 121
is_jc69_site_model <- function(
122 122
  x
@@ -134,20 +134,20 @@
Loading
134 134
#' @examples
135 135
#'
136 136
#' # site models
137 -
#' is_tn93_site_model(create_gtr_site_model()))
138 -
#' is_tn93_site_model(create_hky_site_model()))
139 -
#' is_tn93_site_model(create_jc69_site_model()))
140 -
#' is_tn93_site_model(create_tn93_site_model()))
137 +
#' is_tn93_site_model(create_gtr_site_model())
138 +
#' is_tn93_site_model(create_hky_site_model())
139 +
#' is_tn93_site_model(create_jc69_site_model())
140 +
#' is_tn93_site_model(create_tn93_site_model())
141 141
#'
142 142
#' # other models
143 -
#' is_tn93_site_model(NA))
144 -
#' is_tn93_site_model(NULL))
145 -
#' is_tn93_site_model("nonsense"))
146 -
#' is_tn93_site_model(""))
147 -
#' is_tn93_site_model(c()))
148 -
#' is_tn93_site_model(create_strict_clock_model()))
149 -
#' is_tn93_site_model(create_bd_tree_prior()))
150 -
#' is_tn93_site_model(create_mcmc()))
143 +
#' is_tn93_site_model(NA)
144 +
#' is_tn93_site_model(NULL)
145 +
#' is_tn93_site_model("nonsense")
146 +
#' is_tn93_site_model("")
147 +
#' is_tn93_site_model(c())
148 +
#' is_tn93_site_model(create_strict_clock_model())
149 +
#' is_tn93_site_model(create_bd_tree_prior())
150 +
#' is_tn93_site_model(create_mcmc())
151 151
#' @export
152 152
is_tn93_site_model <- function(
153 153
  x

@@ -9,11 +9,11 @@
Loading
9 9
#' @author Richèl J.C. Bilderbeek
10 10
#' @examples
11 11
#' # TRUE
12 -
#' is_freq_equilibrium_name("estimated"))
13 -
#' is_freq_equilibrium_name("empirical"))
14 -
#' is_freq_equilibrium_name("all_equal"))
12 +
#' is_freq_equilibrium_name("estimated")
13 +
#' is_freq_equilibrium_name("empirical")
14 +
#' is_freq_equilibrium_name("all_equal")
15 15
#' # FALSE
16 -
#' is_freq_equilibrium_name("nonsense"))
16 +
#' is_freq_equilibrium_name("nonsense")
17 17
#' @export
18 18
is_freq_equilibrium_name <- function(
19 19
  name

@@ -1,12 +1,16 @@
Loading
1 1
#' Creates the MRCA prior's XML for the tracelog section
2 +
#'
3 +
#' Creates the MRCA prior's XML for the tracelog section.
4 +
#'
5 +
#' \code{
6 +
#'   <logger id="tracelog" ...>
7 +
#'     # Here
8 +
#'   </logger>
9 +
#' }
2 10
#' @inheritParams default_params_doc
3 11
#' @return lines of XML text
4 12
#' @seealso all MRCA priors' tracelog section is created
5 13
#'   by \code{\link{mrca_priors_to_xml_tracelog}}
6 -
#' @examples
7 -
#' # <logger id="tracelog" ...>
8 -
#' #'   # Here
9 -
#' # </logger>
10 14
#' @author Richèl J.C. Bilderbeek
11 15
#' @export
12 16
mrca_prior_to_xml_tracelog <- function(

@@ -34,14 +34,14 @@
Loading
34 34
#' @author Richèl J.C. Bilderbeek
35 35
#' @examples
36 36
#'
37 -
#' is_rln_clock_model(create_strict_clock_model()))
38 -
#' is_rln_clock_model(create_rln_clock_model()))
37 +
#' is_rln_clock_model(create_strict_clock_model())
38 +
#' is_rln_clock_model(create_rln_clock_model())
39 39
#'
40 -
#' is_rln_clock_model(NA))
41 -
#' is_rln_clock_model(NULL))
42 -
#' is_rln_clock_model("nonsense"))
43 -
#' is_rln_clock_model(create_jc69_site_model()))
44 -
#' is_rln_clock_model(create_mcmc()))
40 +
#' is_rln_clock_model(NA)
41 +
#' is_rln_clock_model(NULL)
42 +
#' is_rln_clock_model("nonsense")
43 +
#' is_rln_clock_model(create_jc69_site_model())
44 +
#' is_rln_clock_model(create_mcmc())
45 45
#' @export
46 46
is_rln_clock_model <- function(
47 47
  x
@@ -63,14 +63,14 @@
Loading
63 63
#' @author Richèl J.C. Bilderbeek
64 64
#' @examples
65 65
#'
66 -
#' is_strict_clock_model(create_strict_clock_model()))
67 -
#' is_strict_clock_model(create_rln_clock_model()))
66 +
#' is_strict_clock_model(create_strict_clock_model())
67 +
#' is_strict_clock_model(create_rln_clock_model())
68 68
#'
69 -
#' is_strict_clock_model(NA))
70 -
#' is_strict_clock_model(NULL))
71 -
#' is_strict_clock_model("nonsense"))
72 -
#' is_strict_clock_model(create_jc69_site_model()))
73 -
#' is_strict_clock_model(create_mcmc()))
69 +
#' is_strict_clock_model(NA)
70 +
#' is_strict_clock_model(NULL)
71 +
#' is_strict_clock_model("nonsense")
72 +
#' is_strict_clock_model(create_jc69_site_model())
73 +
#' is_strict_clock_model(create_mcmc())
74 74
#' @export
75 75
is_strict_clock_model <- function(
76 76
  x

@@ -301,7 +301,7 @@
Loading
301 301
#' is_lambda_param(create_sigma_param())
302 302
#'
303 303
#' is_lambda_param(NA)
304 -
#' is_lambda_param(NULL))
304 +
#' is_lambda_param(NULL)
305 305
#' is_lambda_param("nonsense")
306 306
#' is_lambda_param(create_jc69_site_model())
307 307
#' is_lambda_param(create_strict_clock_model())

@@ -3,18 +3,18 @@
Loading
3 3
#' @return TRUE if the name is a valid distribution name, FALSE otherwise
4 4
#' @examples
5 5
#' # TRUE
6 -
#' is_distr_name("uniform"))
7 -
#' is_distr_name("normal"))
8 -
#' is_distr_name("one_div_x"))
9 -
#' is_distr_name("log_normal"))
10 -
#' is_distr_name("exponential"))
11 -
#' is_distr_name("gamma"))
12 -
#' is_distr_name("beta"))
13 -
#' is_distr_name("laplace"))
14 -
#' is_distr_name("inv_gamma"))
15 -
#' is_distr_name("poisson"))
6 +
#' is_distr_name("uniform")
7 +
#' is_distr_name("normal")
8 +
#' is_distr_name("one_div_x")
9 +
#' is_distr_name("log_normal")
10 +
#' is_distr_name("exponential")
11 +
#' is_distr_name("gamma")
12 +
#' is_distr_name("beta")
13 +
#' is_distr_name("laplace")
14 +
#' is_distr_name("inv_gamma")
15 +
#' is_distr_name("poisson")
16 16
#' # FALSE
17 -
#' is_distr_name("nonsense"))
17 +
#' is_distr_name("nonsense")
18 18
#' @author Richèl J.C. Bilderbeek
19 19
#' @export
20 20
is_distr_name <- function(name) {

@@ -2,16 +2,18 @@
Loading
2 2
#' a posterior distribution section) of a BEAST2 XML parameter file.
3 3
#'
4 4
#' These lines start with '\code{<distribution id="prior"}'
5 +
#'
6 +
#' \code{
7 +
#'    <distribution id="posterior" spec="util.CompoundDistribution">
8 +
#'        <distribution id="prior" spec="util.CompoundDistribution">
9 +
#'          HERE, where the ID of the distribution is 'prior'
10 +
#'        </distribution>
11 +
#'        <distribution id="likelihood" ...>
12 +
#'        </distribution>
13 +
#'   </distribution>
14 +
#' }
5 15
#' @inheritParams default_params_doc
6 16
#' @return lines of XML text
7 -
#' @examples
8 -
#'  # <distribution id="posterior" spec="util.CompoundDistribution">
9 -
#'  #     <distribution id="prior" spec="util.CompoundDistribution">
10 -
#'  #       HERE, where the ID of the distribution is 'prior'
11 -
#'  #     </distribution>
12 -
#'  #     <distribution id="likelihood" ...>
13 -
#'  #     </distribution>
14 -
#'  # </distribution>
15 17
#' @author Richèl J.C. Bilderbeek
16 18
#' @export
17 19
mrca_priors_to_xml_prior_distr <- function(

@@ -4,7 +4,7 @@
Loading
4 4
#' @return the parameter as XML text
5 5
#' @author Richèl J.C. Bilderbeek
6 6
#' @examples
7 -
#' parameter_to_xml(create_alpha_param(id = 1)
7 +
#' parameter_to_xml(create_alpha_param(id = 1))
8 8
#' @export
9 9
parameter_to_xml <- function( # nolint simplifying further hurts readability
10 10
  parameter

@@ -5,12 +5,12 @@
Loading
5 5
#' @seealso to check multiple IDs, use \link{are_ids}
6 6
#' @examples
7 7
#' # TRUE
8 -
#' is_id("anthus_aco"))
9 -
#' is_id(3))
8 +
#' is_id("anthus_aco")
9 +
#' is_id(3)
10 10
#' # FALSE
11 -
#' is_id(ape::rcoal(3)))
12 -
#' is_id(NULL))
13 -
#' is_id(NA))
11 +
#' is_id(ape::rcoal(3))
12 +
#' is_id(NULL)
13 +
#' is_id(NA)
14 14
#' @export
15 15
is_id <- function(
16 16
  x

@@ -1,12 +1,16 @@
Loading
1 1
#' Creates the MRCA priors' XML for the tracelog section
2 +
#'
3 +
#' Creates the MRCA priors' XML for the tracelog section.
4 +
#'
5 +
#' \code{
6 +
#'   <logger id="tracelog" ...>
7 +
#'    # Here
8 +
#'   </logger>
9 +
#' }
2 10
#' @inheritParams default_params_doc
3 11
#' @return lines of XML text
4 12
#' @seealso the complete tracelog section is created
5 13
#'   by \code{\link{create_tracelog_xml}}
6 -
#' @examples
7 -
#' # <logger id="tracelog" ...>
8 -
#' #'   # Here
9 -
#' # </logger>
10 14
#' @author Richèl J.C. Bilderbeek
11 15
#' @export
12 16
mrca_priors_to_xml_tracelog <- function(

@@ -3,12 +3,12 @@
Loading
3 3
#' @return TRUE if the name is a valid site_model name, FALSE otherwise
4 4
#' @examples
5 5
#' # TRUE
6 -
#' is_site_model_name("JC69"))
7 -
#' is_site_model_name("HKY"))
8 -
#' is_site_model_name("TN93"))
9 -
#' is_site_model_name("GTR"))
6 +
#' is_site_model_name("JC69")
7 +
#' is_site_model_name("HKY")
8 +
#' is_site_model_name("TN93")
9 +
#' is_site_model_name("GTR")
10 10
#' # FALSE
11 -
#' is_site_model_name("nonsense"))
11 +
#' is_site_model_name("nonsense")
12 12
#' @author Richèl J.C. Bilderbeek
13 13
#' @export
14 14
is_site_model_name <- function(name) {

@@ -1,18 +1,23 @@
Loading
1 1
#' Creates the \code{taxonset} section in the prior section of the
2 2
#' distribution section of a BEAST2 XML parameter file.
3 +
#'
4 +
#' Creates the \code{taxonset} section in the prior section of the
5 +
#' distribution section of a BEAST2 XML parameter file.
6 +
#'
7 +
#' \code{
8 +
#'   <taxonset id="all" spec="TaxonSet">
9 +
#'       <taxon id="626029_aco" spec="Taxon"/>
10 +
#'       <taxon id="630116_aco" spec="Taxon"/>
11 +
#'       <taxon id="630210_aco" spec="Taxon"/>
12 +
#'       <taxon id="B25702_aco" spec="Taxon"/>
13 +
#'       <taxon id="61430_aco" spec="Taxon"/>
14 +
#'   </taxonset>
15 +
#' }
3 16
#' @inheritParams default_params_doc
4 17
#' @param taxa_names_with_ids taxa names that already have received
5 18
#'   an ID. Causes the XML to \code{idref} these
6 19
#' @return lines of XML text
7 20
#' @author Richèl J.C. Bilderbeek
8 -
#' @examples
9 -
#'   # <taxonset id="all" spec="TaxonSet">
10 -
#'   #     <taxon id="626029_aco" spec="Taxon"/>
11 -
#'   #     <taxon id="630116_aco" spec="Taxon"/>
12 -
#'   #     <taxon id="630210_aco" spec="Taxon"/>
13 -
#'   #     <taxon id="B25702_aco" spec="Taxon"/>
14 -
#'   #     <taxon id="61430_aco" spec="Taxon"/>
15 -
#'   # </taxonset>
16 21
#' @export
17 22
mrca_prior_to_xml_taxonset <- function(
18 23
  mrca_prior,
Files Coverage
R 99.13%
Project Totals (262 files) 99.13%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading