[R/calc_K.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calc_K.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Calculate the average number of junctions after an infinite number of generations, provided information on the initial heterozygosity, population size and the number of generations.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/calc_K.R:6:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calc_K.R#L6) *style:* **Lines should not be more than 80 characters.**
```r
#' @param C Mean number of crossovers per meiosis (e.g. size in Morgan of the chromosome)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/calc_K.R:11:20:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calc_K.R#L11) *style:* **Variable and function name style should be snake_case.**
```r
calc_k <- function(N = Inf,
                   ^
```
[R/calc_K.R:12:20:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calc_K.R#L12) *style:* **Variable and function name style should be snake_case.**
```r
                   R = Inf,
                   ^
```
[R/calc_K.R:13:20:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calc_K.R#L13) *style:* **Variable and function name style should be snake_case.**
```r
                   H_0 = 0.5,
                   ^~~
```
[R/calc_K.R:14:20:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calc_K.R#L14) *style:* **Variable and function name style should be snake_case.**
```r
                   C = 1) {
                   ^
```
[R/calc_K.R:16:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calc_K.R#L16) *style:* **Variable and function name style should be snake_case.**
```r
  K <- H_0 * C * 2 * N * R / (2 * N * C + R)
  ^
```
[R/calc_K.R:19:5:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calc_K.R#L19) *style:* **Variable and function name style should be snake_case.**
```r
    K <- H_0 * R
    ^
```
[R/calc_K.R:23:5:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calc_K.R#L23) *style:* **Variable and function name style should be snake_case.**
```r
    K <- H_0 * C * 2 * N
    ^
```
[R/calc_K.R:27:5:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calc_K.R#L27) *style:* **Variable and function name style should be snake_case.**
```r
    K <- Inf
    ^
```
[R/calculate_error.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_error.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Calculate the error in the estimate of the onset of hybridisation, following Equations 3 & 4 in the Supplementary information of Janzen et al. 2018.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/calculate_error.R:7:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_error.R#L7) *style:* **Lines should not be more than 80 characters.**
```r
#' @param C Mean number of crossovers per meiosis (e.g. size in Morgan of the chromosome)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/calculate_error.R:9:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_error.R#L9) *style:* **Lines should not be more than 80 characters.**
```r
#' @param relative Boolean flag, if TRUE: return the relative error, if FALSE: return error in generations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/calculate_error.R:15:24:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_error.R#L15) *style:* **Variable and function name style should be snake_case.**
```r
time_error <- function(J = NA,
                       ^
```
[R/calculate_error.R:16:24:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_error.R#L16) *style:* **Variable and function name style should be snake_case.**
```r
                       N = Inf,
                       ^
```
[R/calculate_error.R:17:24:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_error.R#L17) *style:* **Variable and function name style should be snake_case.**
```r
                       R = Inf,
                       ^
```
[R/calculate_error.R:18:24:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_error.R#L18) *style:* **Variable and function name style should be snake_case.**
```r
                       H_0 = 0.5,
                       ^~~
```
[R/calculate_error.R:19:24:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_error.R#L19) *style:* **Variable and function name style should be snake_case.**
```r
                       C = 1,
                       ^
```
[R/calculate_error.R:24:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_error.R#L24) *style:* **Variable and function name style should be snake_case.**
```r
  K <- junctions::calc_k(N, R, H_0, C)
  ^
```
[R/calculate_error.R:30:7:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_error.R#L30) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if ( relative) return(  error)
      ^
```
[R/calculate_error.R:30:25:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_error.R#L30) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if ( relative) return(  error)
                        ^
```
[R/calculate_MAT.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_MAT.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Function that calculates the maximum time after hybridization after which the number of junctions can still be reliably used to estimate the onset of hybridization. This is following equation 15 in Janzen et al. 2018.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/calculate_MAT.R:6:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_MAT.R#L6) *style:* **Lines should not be more than 80 characters.**
```r
#' @param C Mean number of crossovers per meiosis (e.g. size in Morgan of the chromosome)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/calculate_MAT.R:12:27:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_MAT.R#L12) *style:* **Variable and function name style should be snake_case.**
```r
calculate_mat <- function(N = Inf,
                          ^
```
[R/calculate_MAT.R:13:27:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_MAT.R#L13) *style:* **Variable and function name style should be snake_case.**
```r
                          R = Inf,
                          ^
```
[R/calculate_MAT.R:14:27:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_MAT.R#L14) *style:* **Variable and function name style should be snake_case.**
```r
                          H_0 = 0.5,
                          ^~~
```
[R/calculate_MAT.R:15:27:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_MAT.R#L15) *style:* **Variable and function name style should be snake_case.**
```r
                          C = 1) {
                          ^
```
[R/calculate_MAT.R:20:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_MAT.R#L20) *style:* **Variable and function name style should be snake_case.**
```r
  K <- junctions::calc_k(N, R, H_0, C)
  ^
```
[R/calculate_time.R:1:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_time.R#L1) *style:* **Lines should not be more than 80 characters.**
```r
#' Estimate the time since the onset of hybridization, using the number of junctions
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/calculate_time.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_time.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Estimate the time since the onset of hybridization, following equation 14 in Janzen et al. 2018
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/calculate_time.R:7:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_time.R#L7) *style:* **Lines should not be more than 80 characters.**
```r
#' @param C Mean number of crossovers per meiosis (e.g. size in Morgan of the chromosome)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/calculate_time.R:11:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_time.R#L11) *style:* **Lines should not be more than 80 characters.**
```r
#' estimate_time(J = J, N = 100, R = 1000, H_0 = 0.5, C = 1)  # should be 200 again
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/calculate_time.R:13:27:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_time.R#L13) *style:* **Variable and function name style should be snake_case.**
```r
estimate_time <- function(J = NA,
                          ^
```
[R/calculate_time.R:14:27:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_time.R#L14) *style:* **Variable and function name style should be snake_case.**
```r
                          N = Inf,
                          ^
```
[R/calculate_time.R:15:27:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_time.R#L15) *style:* **Variable and function name style should be snake_case.**
```r
                          R = Inf,
                          ^
```
[R/calculate_time.R:16:27:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_time.R#L16) *style:* **Variable and function name style should be snake_case.**
```r
                          H_0 = 0.5,
                          ^~~
```
[R/calculate_time.R:17:27:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_time.R#L17) *style:* **Variable and function name style should be snake_case.**
```r
                          C = 1) {
                          ^
```
[R/calculate_time.R:28:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/calculate_time.R#L28) *style:* **Variable and function name style should be snake_case.**
```r
  K <- junctions::calc_k(N, R, H_0, C)
  ^
```
[R/estimate_time_markers.R:1:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_markers.R#L1) *style:* **Lines should not be more than 80 characters.**
```r
#' Estimate the time since the onset of hybridization, using the observed number of junctions, taking into account the distribution of markers
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate_time_markers.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_markers.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Estimate the time since the onset of hybridization, following equation 1 in Janzen et al. unpublished
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate_time_markers.R:6:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_markers.R#L6) *style:* **Lines should not be more than 80 characters.**
```r
#' @param marker_distribution A vector containing the position of all markers in Morgan.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate_time_markers.R:7:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_markers.R#L7) *style:* **Lines should not be more than 80 characters.**
```r
#' @param lower_lim lower limit of the optimization algorithm. Increase if the expected admixture time is relatively ancient
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate_time_markers.R:8:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_markers.R#L8) *style:* **Lines should not be more than 80 characters.**
```r
#' @param upper_lim upper limit of hte optimization algorithm. If set too large, recent admixture events can be overlooked - best to set as low as possible.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate_time_markers.R:12:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_markers.R#L12) *style:* **Lines should not be more than 80 characters.**
```r
#' J <- number_of_junctions_markers(N = 100, H_0 = 0.5, t = 200, marker_distribution = markers)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate_time_markers.R:18:35:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_markers.R#L18) *style:* **Variable and function name style should be snake_case.**
```r
estimate_time_markers <- function(J = NA,
                                  ^
```
[R/estimate_time_markers.R:19:35:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_markers.R#L19) *style:* **Variable and function name style should be snake_case.**
```r
                                  N = Inf,
                                  ^
```
[R/estimate_time_markers.R:20:35:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_markers.R#L20) *style:* **Variable and function name style should be snake_case.**
```r
                                  H_0 = 0.5,
                                  ^~~
```
[R/estimate_time_markers.R:34:71:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_markers.R#L34) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  fitted <- stats::optimize(to_fit, interval = c(lower_lim, upper_lim) )
                                                                      ^
```
[R/estimate_time_phased.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L2) *style:* **functions should have cyclomatic complexity of less than 15, this has 49.**
```r
get_prob_from_matrix_phased <- function(left, right, p, P) {
^
```
[R/estimate_time_phased.R:2:57:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L2) *style:* **Variable and function name style should be snake_case.**
```r
get_prob_from_matrix_phased <- function(left, right, p, P) {
                                                        ^
```
[R/estimate_time_phased.R:108:19:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L108) *warning:* **no visible global function definition for ‘single_state’**
```r
  seven_states <- single_state(local_time, N = pop_size, d = di)
                  ^~~~~~~~~~~~
```
[R/estimate_time_phased.R:122:23:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L122) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    final_prob <- log( rel_prob )
                      ^
```
[R/estimate_time_phased.R:122:32:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L122) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    final_prob <- log( rel_prob )
                               ^
```
[R/estimate_time_phased.R:125:10:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L125) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  return( log(focal_prob))
         ^
```
[R/estimate_time_phased.R:129:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L129) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Calculates the time since admixture, given unphased ancestry data.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate_time_phased.R:130:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L130) *style:* **Lines should not be more than 80 characters.**
```r
#' @param local_anc_matrix Local_anc can be provided as either matrix with two columns, where the first column represents ancestry on chromosome 1, and the second column represents ancestry on chromosome 2. Ancestry labels used should be [0, 1], where 0 indicates the first ancestor, and 1 indicates the second ancestor. Alternatively, the user can provide a vector using labels indicating whether at the specific marker, the focal individual is homozygous for the first ancestor (label = 1), homozygous for the second ancestor (label = 2), heterozygous [0,1] (label = 3) or heterozygous [1, 0] (label = 4).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate_time_phased.R:134:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L134) *style:* **Lines should not be more than 80 characters.**
```r
#' @param lower_lim lower limit of the optimization algorithm. Increase if the expected admixture time is relatively ancient
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate_time_phased.R:135:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L135) *style:* **Lines should not be more than 80 characters.**
```r
#' @param upper_lim upper limit of hte optimization algorithm. If set too large, recent admixture events can be overlooked - best to set as low as possible.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate_time_phased.R:136:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L136) *style:* **Lines should not be more than 80 characters.**
```r
#' @param optim_pop_size If TRUE, population size is also optimized. Starting point of the optimizaton will then be on the given population size, and half the maximum time.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate_time_phased.R:171:11:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L171) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if (sum( labels %in% 1:4) != length(labels)) {
          ^
```
[R/estimate_time_phased.R:178:58:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_phased.R#L178) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
                      local_anc[2:length(local_anc)]      )
                                                         ^
```
[R/estimate_time_unphased.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L2) *style:* **functions should have cyclomatic complexity of less than 15, this has 28.**
```r
get_prob_from_matrix <- function(left, right, p, P) {
^
```
[R/estimate_time_unphased.R:2:50:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L2) *style:* **Variable and function name style should be snake_case.**
```r
get_prob_from_matrix <- function(left, right, p, P) {
                                                 ^
```
[R/estimate_time_unphased.R:12:24:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L12) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    prob <- (p ^ 2) * ( P[1] + P[4] + P[7] ) +
                       ^
```
[R/estimate_time_unphased.R:12:43:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L12) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    prob <- (p ^ 2) * ( P[1] + P[4] + P[7] ) +
                                          ^
```
[R/estimate_time_unphased.R:18:22:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L18) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    prob <- p * q * ( p * q * P[3] +
                     ^
```
[R/estimate_time_unphased.R:35:24:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L35) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    prob <- (q ^ 2) * ( P[1] + P[4] + P[7]) +
                       ^
```
[R/estimate_time_unphased.R:88:19:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L88) *warning:* **no visible global function definition for ‘single_state’**
```r
  seven_states <- single_state(local_time, N = pop_size, d = di)
                  ^~~~~~~~~~~~
```
[R/estimate_time_unphased.R:102:23:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L102) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    final_prob <- log( rel_prob )
                      ^
```
[R/estimate_time_unphased.R:102:32:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L102) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    final_prob <- log( rel_prob )
                               ^
```
[R/estimate_time_unphased.R:105:12:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L105) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    return( log(focal_prob))
           ^
```
[R/estimate_time_unphased.R:160:11:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L160) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if (sum( labels %in% 1:3) != length(labels)) {
          ^
```
[R/estimate_time_unphased.R:167:58:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/estimate_time_unphased.R#L167) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
                      local_anc[2:length(local_anc)]      )
                                                         ^
```
[R/number_of_junctions_backcross.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_backcross.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Calculate the expected number of junctions after t generations, in a backcrossing mating scheme.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/number_of_junctions_backcross.R:4:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_backcross.R#L4) *style:* **Lines should not be more than 80 characters.**
```r
#' @param C Mean number of crossovers per meiosis (e.g. size in Morgan of the chromosome)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/number_of_junctions_backcross.R:10:43:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_backcross.R#L10) *style:* **Variable and function name style should be snake_case.**
```r
number_of_junctions_backcross <- function(H_0 = 0.5,
                                          ^~~
```
[R/number_of_junctions_backcross.R:11:43:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_backcross.R#L11) *style:* **Variable and function name style should be snake_case.**
```r
                                          C = 1,
                                          ^
```
[R/number_of_junctions_di.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_di.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' Calculate the expected number of junctions between two markers separated by a given amount of recombination
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/number_of_junctions_di.R:3:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_di.R#L3) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Calculate the expected number of junctions after t generations, provided information on the initial heterozygosity, population size, the number of generations since the onset of admixture and the distance between two markers.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/number_of_junctions_di.R:12:36:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_di.R#L12) *style:* **Variable and function name style should be snake_case.**
```r
number_of_junctions_di <- function(N = Inf,
                                   ^
```
[R/number_of_junctions_di.R:13:36:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_di.R#L13) *style:* **Variable and function name style should be snake_case.**
```r
                                   H_0 = 0.5,
                                   ^~~
```
[R/number_of_junctions_markers.R:1:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_markers.R#L1) *style:* **Lines should not be more than 80 characters.**
```r
#' Calculate the expected total number of junctions in a chromosome, given the distribution of markers
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/number_of_junctions_markers.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_markers.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Calculate the expected number of junctions after t generations, provided information on the initial heterozygosity, population size, the number of generations since the onset of admixture and the distribution of markers.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/number_of_junctions_markers.R:6:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_markers.R#L6) *style:* **Lines should not be more than 80 characters.**
```r
#' @param marker_distribution A vector containing the position of all markers in Morgan.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/number_of_junctions_markers.R:20:41:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_markers.R#L20) *style:* **Variable and function name style should be snake_case.**
```r
number_of_junctions_markers <- function(N = Inf,
                                        ^
```
[R/number_of_junctions_markers.R:21:41:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_markers.R#L21) *style:* **Variable and function name style should be snake_case.**
```r
                                        H_0 = 0.5,
                                        ^~~
```
[R/number_of_junctions_markers.R:32:27:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions_markers.R#L32) *warning:* **no visible global function definition for ‘number_of_junctions_di’**
```r
    expected_junctions <- number_of_junctions_di(N, H_0, t, di)
                          ^~~~~~~~~~~~~~~~~~~~~~
```
[R/number_of_junctions.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Calculate the average number of junctions after t generations, provided information on the initial heterozygosity, population size and the number of generations.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/number_of_junctions.R:6:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions.R#L6) *style:* **Lines should not be more than 80 characters.**
```r
#' @param C Mean number of crossovers per meiosis (e.g. size in Morgan of the chromosome)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/number_of_junctions.R:13:33:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions.R#L13) *style:* **Variable and function name style should be snake_case.**
```r
number_of_junctions <- function(N = Inf,
                                ^
```
[R/number_of_junctions.R:14:33:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions.R#L14) *style:* **Variable and function name style should be snake_case.**
```r
                                R = Inf,
                                ^
```
[R/number_of_junctions.R:15:33:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions.R#L15) *style:* **Variable and function name style should be snake_case.**
```r
                                H_0 = 0.5,
                                ^~~
```
[R/number_of_junctions.R:16:33:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions.R#L16) *style:* **Variable and function name style should be snake_case.**
```r
                                C = 1,
                                ^
```
[R/number_of_junctions.R:28:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/number_of_junctions.R#L28) *style:* **Variable and function name style should be snake_case.**
```r
  K <- junctions::calc_k(N, R, H_0, C)
  ^
```
[R/optim_limits.R:5:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/optim_limits.R#L5) *style:* **Lines should not be more than 80 characters.**
```r
#' @param calc_func function to calculate the time, should accept two arguments: upper, lower and should return a stats::optimize object with two properties: $minimum and $objective
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/optim_limits.R:6:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/optim_limits.R#L6) *style:* **Lines should not be more than 80 characters.**
```r
#' @param iterations number of times the boundaries should be adjusted to obtain an estimate that is not close to the boundaries. After this number of iterations is exceeded, NA is returned
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/phased_log_likelihood.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/phased_log_likelihood.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Calculates the log likelihood of observing the phased data, given the population size, initial heterozygosity and time since admixture
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/phased_log_likelihood.R:3:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/phased_log_likelihood.R#L3) *style:* **Lines should not be more than 80 characters.**
```r
#' @param local_anc_matrix Local_anc can be provided as either matrix with two columns, where the first column represents ancestry on chromosome 1, and the second column represents ancestry on chromosome 2. Ancestry labels used should be [0, 1], where 0 indicates the first ancestor, and 1 indicates the second ancestor. Alternatively, the user can provide a vector indicating whether at the specific marker, the focal individual is homozygous for the first ancestor (0), homozygous for the second ancestor (1) or heterozygous (2).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/phased_log_likelihood.R:38:11:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/phased_log_likelihood.R#L38) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if (sum( labels %in% 1:4) != length(labels)) {
          ^
```
[R/phased_log_likelihood.R:45:58:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/phased_log_likelihood.R#L45) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
                      local_anc[2:length(local_anc)]      )
                                                         ^
```
[R/sim_backcrossing.R:7:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_backcrossing.R#L7) *style:* **Lines should not be more than 80 characters.**
```r
#' @param size_in_morgan Mean number of crossovers per meiosis (e.g. size in Morgan of the chromosome)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_backcrossing.R:11:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_backcrossing.R#L11) *style:* **Lines should not be more than 80 characters.**
```r
#' recorded to be returned at the end of the simulation. If left at -1, ancestry is recorded at every generation (computationally heavy).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_backcrossing.R:12:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_backcrossing.R#L12) *style:* **Lines should not be more than 80 characters.**
```r
#' @return List with five entries: average_junctions: average number of junctions over time, detected_junctions: average number of detected junctions, given the markers. markers: vector with the locations of the molecular markers, junction_distribution: distribution of junctions per time step average_heterozygosity: average heterozygosity.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_fin_chrom.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_fin_chrom.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Individual based simulation of the accumulation of junctions for a chromosome with regularly distributed markers.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_fin_chrom.R:5:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_fin_chrom.R#L5) *style:* **Lines should not be more than 80 characters.**
```r
#' @param morgan Mean number of crossovers per meiosis (e.g. size in Morgan of the chromosome)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_fin_chrom.R:9:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_fin_chrom.R#L9) *style:* **Lines should not be more than 80 characters.**
```r
#' @return \item{avgJunctions}{vector of the average number of junctions at time = [0, total_runtime]}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_fin_chrom.R:17:27:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_fin_chrom.R#L17) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
sim_fin_chrom <- function (pop_size = 100,
                          ^
```
[R/sim_fin_chrom.R:22:28:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_fin_chrom.R#L22) *style:* **Variable and function name style should be snake_case.**
```r
                           R = 100) {
                           ^
```
[R/sim_inf_chrom.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_inf_chrom.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Individual based simulation of the accumulation of junctions for a chromosome with an infinite number of recombination sites.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_inf_chrom.R:6:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_inf_chrom.R#L6) *style:* **Lines should not be more than 80 characters.**
```r
#' @param morgan Mean number of crossovers per meiosis (e.g. size in Morgan of the chromosome)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_inf_chrom.R:7:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_inf_chrom.R#L7) *style:* **Lines should not be more than 80 characters.**
```r
#' @param markers The number of genetic markers superimposed on the chromosome. If markers is set to -1, no markers are superimposed (faster simulation)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_inf_chrom.R:9:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_inf_chrom.R#L9) *style:* **Lines should not be more than 80 characters.**
```r
#' @return \item{avgJunctions}{vector of the average number of junctions at time = [0, total_runtime]}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_unphased.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_unphased.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Individual based simulation of the accumulation of junctions, returning phased and unphased data. Ancestry on both chromosomes of 10 randomly sampled individuals per generations is returned.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_unphased.R:6:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_unphased.R#L6) *style:* **Lines should not be more than 80 characters.**
```r
#' @param size_in_morgan Mean number of crossovers per meiosis (e.g. size in Morgan of the chromosome)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_unphased.R:7:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_unphased.R#L7) *style:* **Lines should not be more than 80 characters.**
```r
#' @param number_of_markers The number of genetic markers superimposed on the chromosome.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_unphased.R:8:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_unphased.R#L8) *style:* **Lines should not be more than 80 characters.**
```r
#' @param time_points vector with time points at which local ancestry has to be recorded to be returned at the end of the simulation. If left at -1, ancestry is recorded at every generation (computationally heavy).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_unphased.R:12:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_unphased.R#L12) *style:* **Lines should not be more than 80 characters.**
```r
#' @return a tibble with five columns: [time, individual, marker location, ancestry chromosome 1, ancestry chromosome 2]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_with_error.R:1:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_with_error.R#L1) *style:* **Lines should not be more than 80 characters.**
```r
#' Individual Based Simulation of the accumulation of junctions, given phasing error
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_with_error.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_with_error.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Individual based simulation of the accumulation of junctions, returning phased and unphased data. Phased data is
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_with_error.R:3:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_with_error.R#L3) *style:* **Lines should not be more than 80 characters.**
```r
#' generated using a user-provided error rate. Ancestry on both chromosomes of 10 randomly sampled individuals per generations is
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_with_error.R:8:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_with_error.R#L8) *style:* **Lines should not be more than 80 characters.**
```r
#' @param size_in_morgan Mean number of crossovers per meiosis (e.g. size in Morgan of the chromosome)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_with_error.R:9:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_with_error.R#L9) *style:* **Lines should not be more than 80 characters.**
```r
#' @param number_of_markers The number of genetic markers superimposed on the chromosome.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_with_error.R:10:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_with_error.R#L10) *style:* **Lines should not be more than 80 characters.**
```r
#' @param time_points vector with time points at which local ancestry has to be recorded to be returned at the end of the simulation. If left at -1, ancestry is recorded at every generation (computationally heavy).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_with_error.R:15:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_with_error.R#L15) *style:* **Lines should not be more than 80 characters.**
```r
#' @param error_rate fraction of markers that are erroneously phased (e.g. swapped)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_with_error.R:16:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_with_error.R#L16) *style:* **Lines should not be more than 80 characters.**
```r
#' @return a tibble with five columns: [time, individual, marker location, ancestry chromosome 1, ancestry chromosome 2]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_with_error.R:69:4:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_with_error.R#L69) *style:* **Commented code should be removed.**
```r
#  testit::assert(all.equal(unique(phased_data$location), selected_markers))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/sim_phased_with_error.R:71:6:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_with_error.R#L71) *style:* **Place a space before left parenthesis, except in a function call.**
```r
  for(i in unique(phased_data$individual)) {
     ^
```
[R/sim_phased_with_error.R:77:7:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/sim_phased_with_error.R#L77) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    if(length(to_flip) > 0) {
      ^
```
[R/unphased_log_likelihood.R:2:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/unphased_log_likelihood.R#L2) *style:* **Lines should not be more than 80 characters.**
```r
#' @description Calculates the log likelihood of observing the unphased data, given the population size, initial heterozygosity and time since admixture
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/unphased_log_likelihood.R:3:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/unphased_log_likelihood.R#L3) *style:* **Lines should not be more than 80 characters.**
```r
#' @param local_anc_matrix Local_anc can be provided as either matrix with two columns, where the first column represents ancestry on chromosome 1, and the second column represents ancestry on chromosome 2. Ancestry labels used should be [0, 1], where 0 indicates the first ancestor, and 1 indicates the second ancestor. Alternatively, the user can provide a vector indicating whether at the specific marker, the focal individual is homozygous for the first ancestor (0), homozygous for the second ancestor (1) or heterozygous (2).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/unphased_log_likelihood.R:34:11:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/unphased_log_likelihood.R#L34) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if (sum( labels %in% 1:3) != length(labels)) {
          ^
```
[R/unphased_log_likelihood.R:41:58:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/unphased_log_likelihood.R#L41) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
                      local_anc[2:length(local_anc)]      )
                                                         ^
```
[R/util.R:22:10:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L22) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  return( get_states_vector(local_anc))
         ^
```
[R/util.R:22:11:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L22) *warning:* **no visible global function definition for ‘get_states_vector’**
```r
  return( get_states_vector(local_anc))
          ^~~~~~~~~~~~~~~~~
```
[R/util.R:26:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L26) *style:* **functions should have cyclomatic complexity of less than 15, this has 32.**
```r
get_states_vector <- function(local_anc) {
^
```
[R/util.R:46:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L46) *style:* **functions should have cyclomatic complexity of less than 15, this has 34.**
```r
get_states_phased <- function(local_anc_matrix) {
^
```
[R/util.R:56:42:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L56) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
                    (local_anc_matrix[, 1 ] == local_anc_matrix[, 2]))
                                         ^
```
[R/util.R:108:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L108) *style:* **Variable and function name style should be snake_case.**
```r
get_expectation_O_state <- function(P, p, focal_state) {
^~~~~~~~~~~~~~~~~~~~~~~
```
[R/util.R:108:37:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L108) *style:* **Variable and function name style should be snake_case.**
```r
get_expectation_O_state <- function(P, p, focal_state) {
                                    ^
```
[R/util.R:116:49:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L116) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if (focal_state == 3) cond_prob <- (q ^ 2) * ( P[1] + P[4] + P[7]) +
                                                ^
```
[R/util.R:122:49:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L122) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if (focal_state == 4) cond_prob <- (p ^ 2) * ( P[1] + P[4] + P[7]) +
                                                ^
```
[R/util.R:146:1:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L146) *style:* **Variable and function name style should be snake_case.**
```r
get_expectation_O_state_phased <- function(P, p, focal_state) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/util.R:146:44:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L146) *style:* **Variable and function name style should be snake_case.**
```r
get_expectation_O_state_phased <- function(P, p, focal_state) {
                                           ^
```
[R/util.R:151:18:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/R/util.R#L151) *warning:* **no visible global function definition for ‘get_expectation_O_state’**
```r
    cond_prob <- get_expectation_O_state(P, p, focal_state)
                 ^~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test-equations.R:11:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-equations.R#L11) *style:* **Variable and function name style should be snake_case.**
```r
  A <- is.infinite(v3)
  ^
```
[tests/testthat/test-equations.R:18:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-equations.R#L18) *style:* **Variable and function name style should be snake_case.**
```r
  J <- junctions::number_of_junctions(N = 100, R = 1000,
  ^
```
[tests/testthat/test-marker_dist.R:4:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-marker_dist.R#L4) *style:* **Variable and function name style should be snake_case.**
```r
  R <- 1000
  ^
```
[tests/testthat/test-marker_dist.R:16:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-marker_dist.R#L16) *style:* **Variable and function name style should be snake_case.**
```r
  N <- 1e3
  ^
```
[tests/testthat/test-marker_dist.R:17:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-marker_dist.R#L17) *style:* **Variable and function name style should be snake_case.**
```r
  R <- 1000
  ^
```
[tests/testthat/test-marker_dist.R:60:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-marker_dist.R#L60) *style:* **Variable and function name style should be snake_case.**
```r
  N <- 1e3
  ^
```
[tests/testthat/test-marker_dist.R:61:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-marker_dist.R#L61) *style:* **Variable and function name style should be snake_case.**
```r
  R <- 1000
  ^
```
[tests/testthat/test-phased-error.R:53:31:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-phased-error.R#L53) *style:* **Put spaces around all infix operators.**
```r
  expected_heterozygosity <- 2*0.5*0.5 * (1 - 1 / (2*100) )^200
                             ~^~
```
[tests/testthat/test-phased-error.R:53:35:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-phased-error.R#L53) *style:* **Put spaces around all infix operators.**
```r
  expected_heterozygosity <- 2*0.5*0.5 * (1 - 1 / (2*100) )^200
                                 ~^~
```
[tests/testthat/test-phased-error.R:53:53:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-phased-error.R#L53) *style:* **Put spaces around all infix operators.**
```r
  expected_heterozygosity <- 2*0.5*0.5 * (1 - 1 / (2*100) )^200
                                                   ~^~
```
[tests/testthat/test-phased-error.R:53:58:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-phased-error.R#L53) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  expected_heterozygosity <- 2*0.5*0.5 * (1 - 1 / (2*100) )^200
                                                         ^
```
[tests/testthat/test-phased-error.R:55:6:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-phased-error.R#L55) *style:* **Place a space before left parenthesis, except in a function call.**
```r
  for(i in unique(true_data$individual)) {
     ^
```
[tests/testthat/test-sims.R:4:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-sims.R#L4) *style:* **Variable and function name style should be snake_case.**
```r
  R <- 100 #chromosome size
  ^
```
[tests/testthat/test-sims.R:5:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-sims.R#L5) *style:* **Variable and function name style should be snake_case.**
```r
  N <- 100 #population size
  ^
```
[tests/testthat/test-sims.R:6:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-sims.R#L6) *style:* **Variable and function name style should be snake_case.**
```r
  H_0 <- 0.5 #initial heterozygosity
  ^~~
```
[tests/testthat/test-sims.R:7:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-sims.R#L7) *style:* **Variable and function name style should be snake_case.**
```r
  C <- 1 #number of recombinations per meiosis
  ^
```
[tests/testthat/test-sims.R:29:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-sims.R#L29) *style:* **Variable and function name style should be snake_case.**
```r
  N <- 50 #population size
  ^
```
[tests/testthat/test-sims.R:30:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-sims.R#L30) *style:* **Variable and function name style should be snake_case.**
```r
  H_0 <- 0.5 #initial heterozygosity
  ^~~
```
[tests/testthat/test-sims.R:31:3:](https://github.com/thijsjanzen/junctions/blob/6a31ed3cc5bbf1c86eb64e3550aa7df6d3ed3bb4/tests/testthat/test-sims.R#L31) *style:* **Variable and function name style should be snake_case.**
```r
  C <- 1 #number of recombinations per meiosis
  ^
```


Aquesta commit era un error


True. removed


As discussed in the ticket, this changes the behvaior of Nest - there may be developers using this existing event to do some final bootstrapping _before_ the app starts taking requests. I'd go for two distinct events:
- one to do final setup tasks (what the event did before)
- one to notify that the app is now ready and listening (what the event is now with this PR).


Successfully aliased the URL <https://micro-link-oc6gqrsql.now.sh> to the following aliases:

* https://micro-link.ovyerus.now.sh
* https://micro-link-git-master.ovyerus.now.sh


neo.hello: hello im dev


Successfully aliased the URL <https://nestjs-mongodb-71ko6mtcm.now.sh> to the following aliases:

* https://nestjs-mongodb.webmasterdevlin.now.sh
* https://nestjs-mongodb-git-master.webmasterdevlin.now.sh


add a Unit test for this method


Ok I'll move it one level up: It will be still be in the main loop (so the check will be performed once per node and the time until the interruption will be at most the time of a single node contraction (well below a second which should be ok ?)


It was https://github.com/RobotLocomotion/drake/pull/12014.


Du kunne evt. ha skrevet det som i sta:
`.map { Ferie(it.fom, it.tom ?: throw RuntimeException("Ferie mangler tom-dato")) }`
Jeg liker den skrivemåten bedre, men det er smak og behag


### Keybase proof

I hereby claim:

  * I am berkantasci on github.
  * I am berkantasci (https://keybase.io/berkantasci) on keybase.
  * I have a public key ASCeZs-RUQD9u-H5qHT-65YW18wLjKCzyqQysa9DNc6IJgo

To claim this, I am signing this object:

```json
{
  "body": {
    "key": {
      "eldest_kid": "01209e66cf915100fdbbe1f9a874feeb9616d7cc0b8ca0b3caa432b1af4335ce88260a",
      "host": "keybase.io",
      "kid": "01209e66cf915100fdbbe1f9a874feeb9616d7cc0b8ca0b3caa432b1af4335ce88260a",
      "uid": "b64137d62aa64aec21fc1f112eebe919",
      "username": "berkantasci"
    },
    "merkle_root": {
      "ctime": 1568114076,
      "hash": "02a990d9d6f7b9edcd9623c1f475d6516e5580c07f4a9d43d350e48c2c9af2e7a6264b1a1dfef85da39069e15a68efd4eaad83879976006cc16d5aa7ea58a3d7",
      "hash_meta": "f2bae48c0be6b8ecac5f91fe52002727c95259f52f3fbb0209f4a7645db4eb7b",
      "seqno": 6384868
    },
    "service": {
      "entropy": "tQ2MJHWwhearT/fBNLZVcMEk",
      "name": "github",
      "username": "berkantasci"
    },
    "type": "web_service_binding",
    "version": 2
  },
  "client": {
    "name": "keybase.io go client",
    "version": "4.4.0"
  },
  "ctime": 1568114082,
  "expire_in": 504576000,
  "prev": "4cc493b34c75b4fcba761d0044ceca95a6a0d927cf1ee3eadd8f4925443d8dca",
  "seqno": 13,
  "tag": "signature"
}
```

with the key [ASCeZs-RUQD9u-H5qHT-65YW18wLjKCzyqQysa9DNc6IJgo](https://keybase.io/berkantasci), yielding the signature:

```
hKRib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEgnmbPkVEA/bvh+ah0/uuWFtfMC4ygs8qkMrGvQzXOiCYKp3BheWxvYWTESpcCDcQgTMSTs0x1tPy6dh0ARM7Klaag2SfPHuPq3Y9JJUQ9jcrEIDRoxD+F6HrBO7cqMLknm7LjP0iUpsB+Z5pNoOIbeMsFAgHCo3NpZ8RAa9QwH96LsLQPdNtnWfm1Xgec6HeNbJT5RAw1W1TzZOD9fqWsKdbiKIkg8tibUoLG8MRUarYz9041P7cCEvC4B6hzaWdfdHlwZSCkaGFzaIKkdHlwZQildmFsdWXEIEehMqAcWOfh03rhochqGuHL2X5is/JR6vXVATx7ZYk6o3RhZ80CAqd2ZXJzaW9uAQ==

```

And finally, I am proving ownership of the github account by posting this as a gist.

### My publicly-auditable identity:

https://keybase.io/berkantasci

### From the command line:

Consider the [keybase command line program](https://keybase.io/download).

```bash
# look me up
keybase id berkantasci
```


#### `terraform plan` Success

<details><summary>Show Output</summary>

```diff

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create

Terraform will perform the following actions:

  # aws_vpc.VPC will be created
+ resource "aws_vpc" "VPC" {
      + arn                              = (known after apply)
      + assign_generated_ipv6_cidr_block = false
      + cidr_block                       = "192.168.0.0/24"
      + default_network_acl_id           = (known after apply)
      + default_route_table_id           = (known after apply)
      + default_security_group_id        = (known after apply)
      + dhcp_options_id                  = (known after apply)
      + enable_classiclink               = (known after apply)
      + enable_classiclink_dns_support   = (known after apply)
      + enable_dns_hostnames             = true
      + enable_dns_support               = true
      + id                               = (known after apply)
      + instance_tenancy                 = "default"
      + ipv6_association_id              = (known after apply)
      + ipv6_cidr_block                  = (known after apply)
      + main_route_table_id              = (known after apply)
      + owner_id                         = (known after apply)
      + tags                             = {
          + "Name" = "cane.test.vpc"
        }
    }

Plan: 1 to add, 0 to change, 0 to destroy.
```

</details>

*Workflow: `Terraform-Plan`, Action: `canelkatmisterraform-github-actions`*


Test Comment


Successfully aliased the URL <https://nestjs-mongodb-nor2tbp7f.now.sh> to the following aliases:

* https://nestjs-mongodb.webmasterdevlin.now.sh
* https://nestjs-mongodb-git-master.webmasterdevlin.now.sh


[R/ods_find_higher_geographies.R:17:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_higher_geographies.R#L17) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_find_higher_geographies.R:19:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_higher_geographies.R#L19) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_find_higher_geographies.R:22:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_higher_geographies.R#L22) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_find_higher_geographies.R:25:60:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_higher_geographies.R#L25) *style:* **Commented code should be removed.**
```r
    ?data <http://purl.org/linked-data/sdmx/2009/dimension#refArea> ?geographyURI.
                                                           ^~~~~~~~~~~~~~~~~~~~~~~
```
[R/ods_find_higher_geographies.R:33:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_higher_geographies.R#L33) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_find_higher_geographies.R:35:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_higher_geographies.R#L35) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_find_higher_geographies.R:37:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_higher_geographies.R#L37) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_find_lower_geographies.R:17:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_lower_geographies.R#L17) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_find_lower_geographies.R:19:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_lower_geographies.R#L19) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_find_lower_geographies.R:22:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_lower_geographies.R#L22) *style:* **Trailing whitespace is superfluous.**
```r

^~~~~~~~~~~~~~~~~~
```
[R/ods_find_lower_geographies.R:25:74:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_lower_geographies.R#L25) *style:* **Commented code should be removed.**
```r
                  ?data <http://purl.org/linked-data/sdmx/2009/dimension#refArea> ?geographyURI.
                                                                         ^~~~~~~~~~~~~~~~~~~~~~~
```
[R/ods_find_lower_geographies.R:33:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_lower_geographies.R#L33) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_find_lower_geographies.R:35:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_lower_geographies.R#L35) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_find_lower_geographies.R:37:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_find_lower_geographies.R#L37) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_get_csv.R:30:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_get_csv.R#L30) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[R/ods_print_query.R:21:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L21) *style:* **functions should have cyclomatic complexity of less than 15, this has 16.**
```r
ods_print_query <- function(dataset,
^
```
[R/ods_print_query.R:26:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L26) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:43:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L43) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:56:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L56) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:63:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L63) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:75:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L75) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[R/ods_print_query.R:78:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L78) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:81:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L81) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:101:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L101) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:103:5:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L103) *style:* **Place a space before left parenthesis, except in a function call.**
```r
  if(!is.null(geography)) {
    ^
```
[R/ods_print_query.R:104:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L104) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[R/ods_print_query.R:106:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L106) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[R/ods_print_query.R:112:58:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L112) *style:* **Only use double-quotes.**
```r
                                                   (stop('Geography code not in sc, la, hd, iz, or dz'))
                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ods_print_query.R:114:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L114) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[R/ods_print_query.R:115:151:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L115) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    query_addition <- paste0("filter (strstarts(strafter(str(?refAreaURI),'http://statistics.gov.scot/id/statistical-geography/'),'", geo_code, "'))." )
                                                                                ^
```
[R/ods_print_query.R:116:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L116) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[R/ods_print_query.R:119:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L119) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:123:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L123) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:129:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L129) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:131:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L131) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[R/ods_print_query.R:134:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L134) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[R/ods_print_query.R:142:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L142) *style:* **Trailing whitespace is superfluous.**
```r

^~~~~~~~
```
[R/ods_print_query.R:159:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L159) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[R/ods_print_query.R:161:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L161) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[R/ods_print_query.R:163:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L163) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:166:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L166) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:169:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L169) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[R/ods_print_query.R:171:1:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/R/ods_print_query.R#L171) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[tests/testthat/test_ods_dataset.R:39:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_dataset.R#L39) *style:* **Commented code should be removed.**
```r
#  skip_on_cran()
   ^~~~~~~~~~~~~~
```
[tests/testthat/test_ods_dataset.R:40:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_dataset.R#L40) *style:* **Commented code should be removed.**
```r
#  expect_equal(ods_dataset(dataset = "average-household-size", geography = "S12000039")$refArea[1], "West Dunbartonshire")
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_dataset.R:44:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_dataset.R#L44) *style:* **Commented code should be removed.**
```r
#  skip_on_cran()
   ^~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:1:2:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L1) *style:* **Commented code should be removed.**
```r
#context("ods_print_query")
 ^~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:3:2:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L3) *style:* **Commented code should be removed.**
```r
#expected_return_value1 <- "PREFIX qb: <http://purl.org/linked-data/cube#>"
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:4:2:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L4) *style:* **Commented code should be removed.**
```r
#expected_return_value2 <- "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>"
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:5:2:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L5) *style:* **Commented code should be removed.**
```r
#expected_return_value3 <- "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>"
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:6:2:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L6) *style:* **Commented code should be removed.**
```r
#expected_return_value4 <- "select  \\?value where \\{ \\?data qb:dataSet <http://statistics\\.gov\\.scot/data/average-house-size>\\. \\?data  \\.  rdfs:label \\. \\?data  \\.  rdfs:label \\. \\?data \\?measureTypeURI \\?value\\. \\}"
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:7:2:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L7) *style:* **Commented code should be removed.**
```r
#expected_return_value5 <- "select  \\?value where \\{ \\?data qb:dataSet <http://statistics\\.gov\\.scot/data/average-house-size>\\. \\?data  \\.  rdfs:label \\. \\?data  \\.  rdfs:label \\. FILTER \\(\\?refPeriod >= '2017'\\^\\^xsd:date && \\?refPeriod <= '2018'\\^\\^xsd:date\\) \\?data \\?measureTypeURI \\?value\\. \\}"
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:9:2:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L9) *style:* **Commented code should be removed.**
```r
#printed_query <- ods_print_query("average-house-size")
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:15:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L15) *style:* **Commented code should be removed.**
```r
#  skip_on_cran()
   ^~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:16:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L16) *style:* **Commented code should be removed.**
```r
#  expect_match(printed_query, expected_return_value1)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:17:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L17) *style:* **Commented code should be removed.**
```r
#  expect_match(printed_query, expected_return_value2)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:18:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L18) *style:* **Commented code should be removed.**
```r
#  expect_match(printed_query, expected_return_value3)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:19:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L19) *style:* **Commented code should be removed.**
```r
#  expect_match(printed_query, expected_return_value4)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:23:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L23) *style:* **Commented code should be removed.**
```r
#  skip_on_cran()
   ^~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:24:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L24) *style:* **Commented code should be removed.**
```r
#  expect_match(printed_query_with_filter, expected_return_value1)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:25:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L25) *style:* **Commented code should be removed.**
```r
#  expect_match(printed_query_with_filter, expected_return_value2)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:26:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L26) *style:* **Commented code should be removed.**
```r
#  expect_match(printed_query_with_filter, expected_return_value3)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test_ods_print_query.R:27:4:](https://github.com/DataScienceScotland/opendatascot/blob/c9c73c45fecb61d15fbb1c9b4a3325e289885414/tests/testthat/test_ods_print_query.R#L27) *style:* **Commented code should be removed.**
```r
#  expect_match(printed_query_with_filter, expected_return_value5)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```


кц5нкуценп


### Keybase proof

I hereby claim:

  * I am kennyklexzy on github.
  * I am kennyklexzy (https://keybase.io/kennyklexzy) on keybase.
  * I have a public key ASD6TwFAitQZpSNO4xDvR4wvs9O07MUDASMQ-fDrdM1_8Ao

To claim this, I am signing this object:

```json
{
  "body": {
    "key": {
      "eldest_kid": "0120fa4f01408ad419a5234ee310ef478c2fb3d3b4ecc503012310f9f0eb74cd7ff00a",
      "host": "keybase.io",
      "kid": "0120fa4f01408ad419a5234ee310ef478c2fb3d3b4ecc503012310f9f0eb74cd7ff00a",
      "uid": "9e3da5faecc254d10f06e86ff0a7c319",
      "username": "kennyklexzy"
    },
    "merkle_root": {
      "ctime": 1568113924,
      "hash": "674b0e1e707b85061f3f07914801db9139d8536757c35dc57e2df271491b859623e0eb539fb1088b202d302fd02181047b8fea0057efd848ad62de7fa95fdfed",
      "hash_meta": "9a12c509fd40e98c5e2c315c5b4763aebcf904da5a3569d5fc8f730c27a3aa27",
      "seqno": 6384313
    },
    "service": {
      "entropy": "Y+fdYGIAuCzV2F86YXw8qdBt",
      "name": "github",
      "username": "kennyklexzy"
    },
    "type": "web_service_binding",
    "version": 2
  },
  "client": {
    "name": "keybase.io go client",
    "version": "4.4.0"
  },
  "ctime": 1568114024,
  "expire_in": 504576000,
  "prev": "6ca0a68ddf79c50fbd3d2fa2b67959f88b54320eb4a5ac06b4253cf7bd67137c",
  "seqno": 5,
  "tag": "signature"
}
```

with the key [ASD6TwFAitQZpSNO4xDvR4wvs9O07MUDASMQ-fDrdM1_8Ao](https://keybase.io/kennyklexzy), yielding the signature:

```
hKRib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEg+k8BQIrUGaUjTuMQ70eML7PTtOzFAwEjEPnw63TNf/AKp3BheWxvYWTESpcCBcQgbKCmjd95xQ+9PS+itnlZ+ItUMg60pawGtCU8971nE3zEIBwJGcr43iBf8SQuI0l0+V4YUbTYep8q8fUvM1VIVkdQAgHCo3NpZ8RAQMPMHswYb2l3wdwdCB15GlXDCgPAVzqPb1yRLI+qyLiBECteXdAR7/wk2aXqGmpQrzJCHl+z1l/ExDoXGBguCahzaWdfdHlwZSCkaGFzaIKkdHlwZQildmFsdWXEICm4oT+bPR3eUARXsmZEneGBEu6T/+BNGM9M+Q8pr4lpo3RhZ80CAqd2ZXJzaW9uAQ==

```

And finally, I am proving ownership of the github account by posting this as a gist.

### My publicly-auditable identity:

https://keybase.io/kennyklexzy

### From the command line:

Consider the [keybase command line program](https://keybase.io/download).

```bash
# look me up
keybase id kennyklexzy
```


done


✅ Device tests passed on iOS on [Azure DevOps](https://dev.azure.com/devdiv/DevDiv/_build/index?buildId=3035547)(iOS): [Html Report](http://xamarin-storage/jenkins/xamarin-macios/master/14559e35bd7c0846df07c5f0faf1a95b680e78c3/3035547/device-tests/jenkins-results/tests/index.html) ✅

# Test results

# All 113 tests passed