[R/as-points.R:6:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/as-points.R#L6) *style:* **Lines should not be more than 120 characters.**
```r
#' @param input_unit Unit of \code{x}, default is millimeters which is default in \code{ggplot2::geom_text}, among other functions.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/colors.R:23:17:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/colors.R#L23) *style:* **Commas should always have a space after.**
```r
    c('#EF0107','#023474','#9C824A')[1:n]
                ^
```
[R/colors.R:23:27:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/colors.R#L23) *style:* **Commas should always have a space after.**
```r
    c('#EF0107','#023474','#9C824A')[1:n]
                          ^
```
[R/estimate-vaf.R:10:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L10) *style:* **Lines should not be more than 120 characters.**
```r
#' @return Object containing expected VAFs if the tumor is on the major (\code{mcn}) or minor allele (\code{lcn}), respectively.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate-vaf.R:17:34:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L17) *style:* **Put spaces around all infix operators.**
```r
    tumor_normal_alleles = purity*tcn + (1-purity)*2 # total number of alleles in sample
                                ~^~
```
[R/estimate-vaf.R:17:43:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L17) *style:* **Put spaces around all infix operators.**
```r
    tumor_normal_alleles = purity*tcn + (1-purity)*2 # total number of alleles in sample
                                         ~^~
```
[R/estimate-vaf.R:17:51:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L17) *style:* **Put spaces around all infix operators.**
```r
    tumor_normal_alleles = purity*tcn + (1-purity)*2 # total number of alleles in sample
                                                 ~^~
```
[R/estimate-vaf.R:19:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L19) *style:* **Lines should not be more than 120 characters.**
```r
    mcn_mut_alleles = (purity*mcn + (1-purity)) # number of mutated alleles in tumor if mcn, plus mut alleles in normal cells
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate-vaf.R:19:30:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L19) *style:* **Put spaces around all infix operators.**
```r
    mcn_mut_alleles = (purity*mcn + (1-purity)) # number of mutated alleles in tumor if mcn, plus mut alleles in normal cells
                            ~^~
```
[R/estimate-vaf.R:19:39:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L19) *style:* **Put spaces around all infix operators.**
```r
    mcn_mut_alleles = (purity*mcn + (1-purity)) # number of mutated alleles in tumor if mcn, plus mut alleles in normal cells
                                     ~^~
```
[R/estimate-vaf.R:20:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L20) *style:* **Lines should not be more than 120 characters.**
```r
    lcn_mut_alleles = (purity*lcn + (1-purity)) # number of mutated alleles in tumor if lcn, plus mut alleles in normal cells
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/estimate-vaf.R:20:30:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L20) *style:* **Put spaces around all infix operators.**
```r
    lcn_mut_alleles = (purity*lcn + (1-purity)) # number of mutated alleles in tumor if lcn, plus mut alleles in normal cells
                            ~^~
```
[R/estimate-vaf.R:20:39:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L20) *style:* **Put spaces around all infix operators.**
```r
    lcn_mut_alleles = (purity*lcn + (1-purity)) # number of mutated alleles in tumor if lcn, plus mut alleles in normal cells
                                     ~^~
```
[R/estimate-vaf.R:22:32:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L22) *style:* **Put spaces around all infix operators.**
```r
    c(vaf_mcn = mcn_mut_alleles/tumor_normal_alleles, vaf_lcn = lcn_mut_alleles/tumor_normal_alleles)
                              ~^~
```
[R/estimate-vaf.R:22:80:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L22) *style:* **Put spaces around all infix operators.**
```r
    c(vaf_mcn = mcn_mut_alleles/tumor_normal_alleles, vaf_lcn = lcn_mut_alleles/tumor_normal_alleles)
                                                                              ~^~
```
[R/estimate-vaf.R:30:34:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L30) *style:* **Put spaces around all infix operators.**
```r
    tumor_normal_alleles = purity*tcn + (1-purity)*2 # total number of alleles in sample
                                ~^~
```
[R/estimate-vaf.R:30:43:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L30) *style:* **Put spaces around all infix operators.**
```r
    tumor_normal_alleles = purity*tcn + (1-purity)*2 # total number of alleles in sample
                                         ~^~
```
[R/estimate-vaf.R:30:51:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L30) *style:* **Put spaces around all infix operators.**
```r
    tumor_normal_alleles = purity*tcn + (1-purity)*2 # total number of alleles in sample
                                                 ~^~
```
[R/estimate-vaf.R:32:29:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L32) *style:* **Put spaces around all infix operators.**
```r
    mcn_mut_alleles = purity*mcn # number of mutated alleles in tumor if mcn, plus mut alleles in normal cells
                           ~^~
```
[R/estimate-vaf.R:33:29:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L33) *style:* **Put spaces around all infix operators.**
```r
    lcn_mut_alleles = purity*lcn # number of mutated alleles in tumor if lcn, plus mut alleles in normal cells
                           ~^~
```
[R/estimate-vaf.R:35:32:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L35) *style:* **Put spaces around all infix operators.**
```r
    c(vaf_mcn = mcn_mut_alleles/tumor_normal_alleles, vaf_lcn = lcn_mut_alleles/tumor_normal_alleles)
                              ~^~
```
[R/estimate-vaf.R:35:80:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/estimate-vaf.R#L35) *style:* **Put spaces around all infix operators.**
```r
    c(vaf_mcn = mcn_mut_alleles/tumor_normal_alleles, vaf_lcn = lcn_mut_alleles/tumor_normal_alleles)
                                                                              ~^~
```
[R/facets-closeup.R:37:18:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/facets-closeup.R#L37) *style:* **Variable or function name should be snake_case.**
```r
        fit$cncf$cnlr.median = fit$cncf$cnlr.median - out$dipLogR
                 ^~~~~~~~~~~
```
[R/ggplot2-themes.R:40:34:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L40) *style:* **Commas should always have a space after.**
```r
        plot.margin = unit(c(0.5,0.5,0.5,0.5), 'lines')
                                 ^
```
[R/ggplot2-themes.R:40:38:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L40) *style:* **Commas should always have a space after.**
```r
        plot.margin = unit(c(0.5,0.5,0.5,0.5), 'lines')
                                     ^
```
[R/ggplot2-themes.R:40:42:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L40) *style:* **Commas should always have a space after.**
```r
        plot.margin = unit(c(0.5,0.5,0.5,0.5), 'lines')
                                         ^
```
[R/ggplot2-themes.R:49:39:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L49) *style:* **Put spaces around all infix operators.**
```r
        line = element_line(size = .75*(.75/1.6), lineend = 'round'),
                                     ~^~
```
[R/ggplot2-themes.R:49:40:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L49) *style:* **Place a space before left parenthesis, except in a function call.**
```r
        line = element_line(size = .75*(.75/1.6), lineend = 'round'),
                                       ^
```
[R/ggplot2-themes.R:49:44:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L49) *style:* **Put spaces around all infix operators.**
```r
        line = element_line(size = .75*(.75/1.6), lineend = 'round'),
                                          ~^~
```
[R/ggplot2-themes.R:57:63:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L57) *style:* **Put spaces around all infix operators.**
```r
        axis.line.x = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                             ~^~
```
[R/ggplot2-themes.R:57:64:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L57) *style:* **Place a space before left parenthesis, except in a function call.**
```r
        axis.line.x = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                               ^
```
[R/ggplot2-themes.R:57:68:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L57) *style:* **Put spaces around all infix operators.**
```r
        axis.line.x = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                                  ~^~
```
[R/ggplot2-themes.R:58:63:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L58) *style:* **Put spaces around all infix operators.**
```r
        axis.line.y = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                             ~^~
```
[R/ggplot2-themes.R:58:64:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L58) *style:* **Place a space before left parenthesis, except in a function call.**
```r
        axis.line.y = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                               ^
```
[R/ggplot2-themes.R:58:68:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L58) *style:* **Put spaces around all infix operators.**
```r
        axis.line.y = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                                  ~^~
```
[R/ggplot2-themes.R:60:64:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L60) *style:* **Put spaces around all infix operators.**
```r
        axis.ticks.x = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                              ~^~
```
[R/ggplot2-themes.R:60:65:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L60) *style:* **Place a space before left parenthesis, except in a function call.**
```r
        axis.ticks.x = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                                ^
```
[R/ggplot2-themes.R:60:69:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L60) *style:* **Put spaces around all infix operators.**
```r
        axis.ticks.x = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                                   ~^~
```
[R/ggplot2-themes.R:61:64:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L61) *style:* **Put spaces around all infix operators.**
```r
        axis.ticks.y = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                              ~^~
```
[R/ggplot2-themes.R:61:65:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L61) *style:* **Place a space before left parenthesis, except in a function call.**
```r
        axis.ticks.y = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                                ^
```
[R/ggplot2-themes.R:61:69:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L61) *style:* **Put spaces around all infix operators.**
```r
        axis.ticks.y = element_line(color = 'black', size = .75*(.75/1.6), lineend = 'round'),
                                                                   ~^~
```
[R/ggplot2-themes.R:67:35:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L67) *style:* **Commas should always have a space after.**
```r
        plot.margin = unit(c(0.25,0.5,0.25,0.25), 'lines')
                                  ^
```
[R/ggplot2-themes.R:67:39:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L67) *style:* **Commas should always have a space after.**
```r
        plot.margin = unit(c(0.25,0.5,0.25,0.25), 'lines')
                                      ^
```
[R/ggplot2-themes.R:67:44:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/ggplot2-themes.R#L67) *style:* **Commas should always have a space after.**
```r
        plot.margin = unit(c(0.25,0.5,0.25,0.25), 'lines')
                                           ^
```
[R/impact-genes.R:15:3:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/impact-genes.R#L15) *style:* **Commented code should be removed.**
```r
# impact_genes = fread('impact-468.txt')
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/impact-genes.R:16:3:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/impact-genes.R#L16) *style:* **Commented code should be removed.**
```r
# devtools::use_data(impact_genes)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/kpjmisc.R:10:3:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/kpjmisc.R#L10) *style:* **Place a space before left parenthesis, except in a function call.**
```r
if(getRversion() >= "2.15.1")  utils::globalVariables(c("."), add = FALSE)
  ^
```
[R/mutation-types.R:11:3:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/mutation-types.R#L11) *style:* **Commented code should be removed.**
```r
# save(coding_mutations, file = 'data/coding_mutations.rda')
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mutation-types.R:18:3:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/mutation-types.R#L18) *style:* **Commented code should be removed.**
```r
# save(truncating_mutations, file = 'data/truncating_mutations.rda')
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/oncokb-annotate-cna.R:76:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/oncokb-annotate-cna.R#L76) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
{
^
```
[R/plot-stratton.R:15:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L15) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
{
^
```
[R/plot-stratton.R:49:41:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L49) *style:* **Commas should always have a space after.**
```r
            Reference_Allele %in% c('C','T'),
                                        ^
```
[R/plot-stratton.R:50:36:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L50) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,2),Tumor_Seq_Allele2,str_sub(Ref_Tri,3,3)),
                                   ^
```
[R/plot-stratton.R:50:38:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L50) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,2),Tumor_Seq_Allele2,str_sub(Ref_Tri,3,3)),
                                     ^
```
[R/plot-stratton.R:50:41:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L50) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,2),Tumor_Seq_Allele2,str_sub(Ref_Tri,3,3)),
                                        ^
```
[R/plot-stratton.R:50:59:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L50) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,2),Tumor_Seq_Allele2,str_sub(Ref_Tri,3,3)),
                                                          ^
```
[R/plot-stratton.R:50:75:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L50) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,2),Tumor_Seq_Allele2,str_sub(Ref_Tri,3,3)),
                                                                          ^
```
[R/plot-stratton.R:50:77:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L50) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,2),Tumor_Seq_Allele2,str_sub(Ref_Tri,3,3)),
                                                                            ^
```
[R/plot-stratton.R:51:36:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L51) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,1),nt_comp[Reference_Allele],nt_comp[Tumor_Seq_Allele2],str_sub(Ref_Tri,3,3)))) %>%
                                   ^
```
[R/plot-stratton.R:51:38:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L51) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,1),nt_comp[Reference_Allele],nt_comp[Tumor_Seq_Allele2],str_sub(Ref_Tri,3,3)))) %>%
                                     ^
```
[R/plot-stratton.R:51:41:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L51) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,1),nt_comp[Reference_Allele],nt_comp[Tumor_Seq_Allele2],str_sub(Ref_Tri,3,3)))) %>%
                                        ^
```
[R/plot-stratton.R:51:67:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L51) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,1),nt_comp[Reference_Allele],nt_comp[Tumor_Seq_Allele2],str_sub(Ref_Tri,3,3)))) %>%
                                                                  ^
```
[R/plot-stratton.R:51:94:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L51) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,1),nt_comp[Reference_Allele],nt_comp[Tumor_Seq_Allele2],str_sub(Ref_Tri,3,3)))) %>%
                                                                                ^
```
[R/plot-stratton.R:51:110:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L51) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,1),nt_comp[Reference_Allele],nt_comp[Tumor_Seq_Allele2],str_sub(Ref_Tri,3,3)))) %>%
                                                                                ^
```
[R/plot-stratton.R:51:112:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L51) *style:* **Commas should always have a space after.**
```r
            paste0(str_sub(Ref_Tri,1,1),nt_comp[Reference_Allele],nt_comp[Tumor_Seq_Allele2],str_sub(Ref_Tri,3,3)))) %>%
                                                                                ^
```
[R/plot-stratton.R:52:39:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L52) *style:* **Commas should always have a space after.**
```r
        filter(str_sub(TriNuc_Context,2,2) != str_sub(TriNuc_Context,3,3)) %>%
                                      ^
```
[R/plot-stratton.R:52:41:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L52) *style:* **Commas should always have a space after.**
```r
        filter(str_sub(TriNuc_Context,2,2) != str_sub(TriNuc_Context,3,3)) %>%
                                        ^
```
[R/plot-stratton.R:52:70:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L52) *style:* **Commas should always have a space after.**
```r
        filter(str_sub(TriNuc_Context,2,2) != str_sub(TriNuc_Context,3,3)) %>%
                                                                     ^
```
[R/plot-stratton.R:52:72:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L52) *style:* **Commas should always have a space after.**
```r
        filter(str_sub(TriNuc_Context,2,2) != str_sub(TriNuc_Context,3,3)) %>%
                                                                       ^
```
[R/plot-stratton.R:57:42:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L57) *style:* **Put spaces around all infix operators.**
```r
        mutate(TriNuc_Frac = TriNuc_Count/sum(TriNuc_Count)) %>%
                                        ~^~
```
[R/plot-stratton.R:59:59:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L59) *style:* **Commas should always have a space after.**
```r
        mutate(Transition = paste0(str_sub(TriNuc_Context,2,2),'>',str_sub(TriNuc_Context,3,3)))
                                                          ^
```
[R/plot-stratton.R:59:61:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L59) *style:* **Commas should always have a space after.**
```r
        mutate(Transition = paste0(str_sub(TriNuc_Context,2,2),'>',str_sub(TriNuc_Context,3,3)))
                                                            ^
```
[R/plot-stratton.R:59:64:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L59) *style:* **Commas should always have a space after.**
```r
        mutate(Transition = paste0(str_sub(TriNuc_Context,2,2),'>',str_sub(TriNuc_Context,3,3)))
                                                               ^
```
[R/plot-stratton.R:59:68:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L59) *style:* **Commas should always have a space after.**
```r
        mutate(Transition = paste0(str_sub(TriNuc_Context,2,2),'>',str_sub(TriNuc_Context,3,3)))
                                                                   ^
```
[R/plot-stratton.R:59:91:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L59) *style:* **Commas should always have a space after.**
```r
        mutate(Transition = paste0(str_sub(TriNuc_Context,2,2),'>',str_sub(TriNuc_Context,3,3)))
                                                                                ^
```
[R/plot-stratton.R:59:93:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L59) *style:* **Commas should always have a space after.**
```r
        mutate(Transition = paste0(str_sub(TriNuc_Context,2,2),'>',str_sub(TriNuc_Context,3,3)))
                                                                                ^
```
[R/plot-stratton.R:71:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L71) *style:* **Lines should not be more than 120 characters.**
```r
        scale_x_discrete(labels = paste0(str_sub(levels(trinuc_maf$TriNuc_Context),1,2), str_sub(levels(trinuc_maf$TriNuc_Context),4,4))) +
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/plot-stratton.R:71:84:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L71) *style:* **Commas should always have a space after.**
```r
        scale_x_discrete(labels = paste0(str_sub(levels(trinuc_maf$TriNuc_Context),1,2), str_sub(levels(trinuc_maf$TriNuc_Context),4,4))) +
                                                                                ^
```
[R/plot-stratton.R:71:86:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L71) *style:* **Commas should always have a space after.**
```r
        scale_x_discrete(labels = paste0(str_sub(levels(trinuc_maf$TriNuc_Context),1,2), str_sub(levels(trinuc_maf$TriNuc_Context),4,4))) +
                                                                                ^
```
[R/plot-stratton.R:71:132:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L71) *style:* **Commas should always have a space after.**
```r
        scale_x_discrete(labels = paste0(str_sub(levels(trinuc_maf$TriNuc_Context),1,2), str_sub(levels(trinuc_maf$TriNuc_Context),4,4))) +
                                                                                ^
```
[R/plot-stratton.R:71:134:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L71) *style:* **Commas should always have a space after.**
```r
        scale_x_discrete(labels = paste0(str_sub(levels(trinuc_maf$TriNuc_Context),1,2), str_sub(levels(trinuc_maf$TriNuc_Context),4,4))) +
                                                                                ^
```
[R/plot-stratton.R:74:41:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L74) *style:* **Commas should always have a space after.**
```r
        scale_y_continuous(expand = c(0,0)) # +
                                        ^
```
[R/plot-stratton.R:75:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L75) *style:* **Lines should not be more than 120 characters.**
```r
        #geom_hline(yintercept = seq(0, max(as.numeric(trinuc_maf$TriNuc_Frac)), .05), col = 'white', size = .5, alpha = .5)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/plot-stratton.R:75:10:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-stratton.R#L75) *style:* **Commented code should be removed.**
```r
        #geom_hline(yintercept = seq(0, max(as.numeric(trinuc_maf$TriNuc_Frac)), .05), col = 'white', size = .5, alpha = .5)
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/plot-survival.R:34:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L34) *style:* **Use spaces to indent, not tabs.**
```r
	# Tidy data frame
^
```
[R/plot-survival.R:35:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L35) *style:* **Use spaces to indent, not tabs.**
```r
	sf = tidy(survfit_object)
^
```
[R/plot-survival.R:36:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L36) *style:* **Use spaces to indent, not tabs.**
```r
	if (!'strata' %in% names(sf)) sf$strata = ''
^
```
[R/plot-survival.R:38:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L38) *style:* **Use spaces to indent, not tabs.**
```r
	# Add start at 0, by stratum
^
```
[R/plot-survival.R:39:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L39) *style:* **Use spaces to indent, not tabs.**
```r
	top_rows = ldply(unique(sf$strata), function(s) {
^
```
[R/plot-survival.R:40:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L40) *style:* **Use spaces to indent, not tabs.**
```r
		sf_s = filter(sf, strata == s)
^~
```
[R/plot-survival.R:41:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L41) *style:* **Use spaces to indent, not tabs.**
```r
		c(strata = s, time = 0, n.risk = max(sf_s$n.risk),
^~
```
[R/plot-survival.R:42:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L42) *style:* **Use spaces to indent, not tabs.**
```r
			n.event = 0, n.censor = 0, estimate = 1, conf.high = 1, conf.low = 1)
^~~
```
[R/plot-survival.R:43:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L43) *style:* **Use spaces to indent, not tabs.**
```r
		})
^~
```
[R/plot-survival.R:45:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L45) *style:* **Use spaces to indent, not tabs.**
```r
	rbind.fill(sf, top_rows) %>%
^
```
[R/plot-survival.R:46:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L46) *style:* **Use spaces to indent, not tabs.**
```r
		mutate_at(vars(estimate, time), funs(as.numeric(.))) %>%
^~
```
[R/plot-survival.R:47:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L47) *style:* **Use spaces to indent, not tabs.**
```r
	    arrange(strata, time, desc(estimate))
^
```
[R/plot-survival.R:53:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L53) *style:* **Use spaces to indent, not tabs.**
```r
	survfit_object,
^
```
[R/plot-survival.R:54:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L54) *style:* **Use spaces to indent, not tabs.**
```r
	colors = NULL,
^
```
[R/plot-survival.R:55:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L55) *style:* **Use spaces to indent, not tabs.**
```r
	legend_title = NULL,
^
```
[R/plot-survival.R:56:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L56) *style:* **Use spaces to indent, not tabs.**
```r
	plot_title = NULL,
^
```
[R/plot-survival.R:57:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L57) *style:* **Use spaces to indent, not tabs.**
```r
	xmax = NULL,
^
```
[R/plot-survival.R:58:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L58) *style:* **Use spaces to indent, not tabs.**
```r
	parse_strata = FALSE,
^
```
[R/plot-survival.R:59:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L59) *style:* **Use spaces to indent, not tabs.**
```r
	x_lab = NULL,
^
```
[R/plot-survival.R:60:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L60) *style:* **Use spaces to indent, not tabs.**
```r
	y_lab = NULL,
^
```
[R/plot-survival.R:61:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L61) *style:* **Use spaces to indent, not tabs.**
```r
	legend_pos = NULL,
^
```
[R/plot-survival.R:62:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L62) *style:* **Use spaces to indent, not tabs.**
```r
	pval = TRUE,
^
```
[R/plot-survival.R:63:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L63) *style:* **Use spaces to indent, not tabs.**
```r
	pval_pos = NULL,
^
```
[R/plot-survival.R:64:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L64) *style:* **Use spaces to indent, not tabs.**
```r
	interval = NULL,
^
```
[R/plot-survival.R:65:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L65) *style:* **Use spaces to indent, not tabs.**
```r
	env_theme = TRUE,
^
```
[R/plot-survival.R:66:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L66) *style:* **Use spaces to indent, not tabs.**
```r
	table = FALSE
^
```
[R/plot-survival.R:67:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L67) *style:* **Use spaces to indent, not tabs.**
```r
	) {
^
```
[R/plot-survival.R:71:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L71) *style:* **Use spaces to indent, not tabs.**
```r
	if (is.null(legend_title)) {
^
```
[R/plot-survival.R:72:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L72) *style:* **Use spaces to indent, not tabs.**
```r
		# legend_title = stringi::stri_trans_totitle(str_extract(names(survfit_object$strata), '^.*(?=\\=)')[1])
^~
```
[R/plot-survival.R:72:5:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L72) *style:* **Commented code should be removed.**
```r
		# legend_title = stringi::stri_trans_totitle(str_extract(names(survfit_object$strata), '^.*(?=\\=)')[1])
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/plot-survival.R:73:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L73) *style:* **Use spaces to indent, not tabs.**
```r
		legend_title = ''
^~
```
[R/plot-survival.R:74:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L74) *style:* **Use spaces to indent, not tabs.**
```r
	}
^
```
[R/plot-survival.R:75:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L75) *style:* **Use spaces to indent, not tabs.**
```r
	if (length(survfit_object$strata)>1) {
^
```
[R/plot-survival.R:75:35:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L75) *style:* **Put spaces around all infix operators.**
```r
	if (length(survfit_object$strata)>1) {
                                 ~^~
```
[R/plot-survival.R:76:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L76) *style:* **Use spaces to indent, not tabs.**
```r
		# s_labels = str_c(str_extract(names(survfit_object$strata), '(?<==).*'), ' (n=', survfit_object$n, ')')
^~
```
[R/plot-survival.R:76:5:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L76) *style:* **Commented code should be removed.**
```r
		# s_labels = str_c(str_extract(names(survfit_object$strata), '(?<==).*'), ' (n=', survfit_object$n, ')')
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/plot-survival.R:77:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L77) *style:* **Use spaces to indent, not tabs.**
```r
	    s_labels = str_c(str_extract(names(survfit_object$strata), '(?<==).*'))
^
```
[R/plot-survival.R:78:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L78) *style:* **Use spaces to indent, not tabs.**
```r
		if (parse_strata) s_labels = str_replace(s_labels, c('FALSE|0','TRUE|1'), c('WT','Mut'))
^~
```
[R/plot-survival.R:78:66:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L78) *style:* **Commas should always have a space after.**
```r
		if (parse_strata) s_labels = str_replace(s_labels, c('FALSE|0','TRUE|1'), c('WT','Mut'))
                                                                 ^
```
[R/plot-survival.R:78:84:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L78) *style:* **Commas should always have a space after.**
```r
		if (parse_strata) s_labels = str_replace(s_labels, c('FALSE|0','TRUE|1'), c('WT','Mut'))
                                                                                ^
```
[R/plot-survival.R:79:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L79) *style:* **Use spaces to indent, not tabs.**
```r
		sf = mutate(sf, strata = mapvalues(strata, names(survfit_object$strata), s_labels))
^~
```
[R/plot-survival.R:80:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L80) *style:* **Use spaces to indent, not tabs.**
```r
		names(survfit_object$strata) = str_extract(names(survfit_object$strata), '(?<==).*')
^~
```
[R/plot-survival.R:81:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L81) *style:* **Use spaces to indent, not tabs.**
```r
	} else {
^
```
[R/plot-survival.R:82:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L82) *style:* **Use spaces to indent, not tabs.**
```r
		sf$strata = ''
^~
```
[R/plot-survival.R:83:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L83) *style:* **Use spaces to indent, not tabs.**
```r
		s_labels = str_c('n=', survfit_object$n)
^~
```
[R/plot-survival.R:84:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L84) *style:* **Use spaces to indent, not tabs.**
```r
		legend_pos = 'none'
^~
```
[R/plot-survival.R:85:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L85) *style:* **Use spaces to indent, not tabs.**
```r
	}
^
```
[R/plot-survival.R:87:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L87) *style:* **Use spaces to indent, not tabs.**
```r
	if (is.null(x_lab)) x_lab = 'Time'
^
```
[R/plot-survival.R:88:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L88) *style:* **Use spaces to indent, not tabs.**
```r
	if (is.null(y_lab)) y_lab = 'Survival function'
^
```
[R/plot-survival.R:89:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L89) *style:* **Use spaces to indent, not tabs.**
```r
	if (is.null(xmax)) {
^
```
[R/plot-survival.R:90:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L90) *style:* **Use spaces to indent, not tabs.**
```r
	    xmax = 1.04*max(sf$time)
^
```
[R/plot-survival.R:90:17:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L90) *style:* **Put spaces around all infix operators.**
```r
	    xmax = 1.04*max(sf$time)
               ~^~
```
[R/plot-survival.R:91:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L91) *style:* **Use spaces to indent, not tabs.**
```r
	} else {
^
```
[R/plot-survival.R:92:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L92) *style:* **Use spaces to indent, not tabs.**
```r
	    sf = filter(sf, time <= xmax) %>%
^
```
[R/plot-survival.R:93:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L93) *style:* **Use spaces to indent, not tabs.**
```r
	        add_row(strata = unique(sf$strata), time = xmax) %>%
^
```
[R/plot-survival.R:94:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L94) *style:* **Use spaces to indent, not tabs.**
```r
	        arrange(strata, time) %>%
^
```
[R/plot-survival.R:95:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L95) *style:* **Use spaces to indent, not tabs.**
```r
	        tidyr::fill(n.risk, n.event, n.censor, estimate) %>%
^
```
[R/plot-survival.R:96:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L96) *style:* **Use spaces to indent, not tabs.**
```r
	        group_by(strata) %>%
^
```
[R/plot-survival.R:97:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L97) *style:* **Use spaces to indent, not tabs.**
```r
	        filter(
^
```
[R/plot-survival.R:98:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L98) *style:* **Use spaces to indent, not tabs.**
```r
	            !( (time == xmax & n.risk == n.event) & (lag(n.risk) == lag(n.event) )) &
^
```
[R/plot-survival.R:98:16:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L98) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
	            !( (time == xmax & n.risk == n.event) & (lag(n.risk) == lag(n.event) )) &
               ^
```
[R/plot-survival.R:98:82:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L98) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
	            !( (time == xmax & n.risk == n.event) & (lag(n.risk) == lag(n.event) )) &
                                                                                ^
```
[R/plot-survival.R:99:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L99) *style:* **Use spaces to indent, not tabs.**
```r
	            !(time == xmax & lag(n.risk) == 1 & lag(n.censor) == 1)) %>%
^
```
[R/plot-survival.R:100:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L100) *style:* **Use spaces to indent, not tabs.**
```r
	        ungroup
^
```
[R/plot-survival.R:101:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L101) *style:* **Use spaces to indent, not tabs.**
```r
	}
^
```
[R/plot-survival.R:104:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L104) *style:* **Use spaces to indent, not tabs.**
```r
	sf_plot = ggplot(data = sf) +
^
```
[R/plot-survival.R:105:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L105) *style:* **Use spaces to indent, not tabs.**
```r
		geom_step(aes(x = time, y = estimate, group = strata, color = strata), direction = 'hv') +
^~
```
[R/plot-survival.R:106:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L106) *style:* **Use spaces to indent, not tabs.**
```r
		geom_point(data = filter(sf, n.censor == 1), aes(x = time, y = estimate, color = strata), shape= '|',
^~
```
[R/plot-survival.R:106:98:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L106) *style:* **Put spaces around all infix operators.**
```r
		geom_point(data = filter(sf, n.censor == 1), aes(x = time, y = estimate, color = strata), shape= '|',
                                                                                ~^
```
[R/plot-survival.R:107:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L107) *style:* **Use spaces to indent, not tabs.**
```r
			show.legend = F) +
^~~
```
[R/plot-survival.R:108:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L108) *style:* **Use spaces to indent, not tabs.**
```r
	    scale_y_continuous(expand = c(0,0), limits = c(-.01,1.04),
^
```
[R/plot-survival.R:108:38:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L108) *style:* **Commas should always have a space after.**
```r
	    scale_y_continuous(expand = c(0,0), limits = c(-.01,1.04),
                                     ^
```
[R/plot-survival.R:108:58:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L108) *style:* **Commas should always have a space after.**
```r
	    scale_y_continuous(expand = c(0,0), limits = c(-.01,1.04),
                                                         ^
```
[R/plot-survival.R:109:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L109) *style:* **Use spaces to indent, not tabs.**
```r
	                       breaks = seq(0, 1, .25), labels = function(x) 100*x) +
^
```
[R/plot-survival.R:109:74:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L109) *style:* **Put spaces around all infix operators.**
```r
	                       breaks = seq(0, 1, .25), labels = function(x) 100*x) +
                                                                        ~^~
```
[R/plot-survival.R:110:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L110) *style:* **Use spaces to indent, not tabs.**
```r
	    scale_color_manual(values = brewer.pal(8, 'Paired'),
^
```
[R/plot-survival.R:111:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L111) *style:* **Use spaces to indent, not tabs.**
```r
	                       labels = function(x) {
^
```
[R/plot-survival.R:112:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L112) *style:* **Use spaces to indent, not tabs.**
```r
	                           str_c(x, ' (n=', survfit_object$n[match(x, names(survfit_object$strata))], ')')
^
```
[R/plot-survival.R:113:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L113) *style:* **Use spaces to indent, not tabs.**
```r
	                       }) +
^
```
[R/plot-survival.R:114:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L114) *style:* **Use spaces to indent, not tabs.**
```r
		theme(line = element_line(lineend = 'round'),
^~
```
[R/plot-survival.R:115:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L115) *style:* **Use spaces to indent, not tabs.**
```r
		      legend.position = c(1,1), legend.justification = c(1,1),
^~
```
[R/plot-survival.R:115:31:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L115) *style:* **Commas should always have a space after.**
```r
		      legend.position = c(1,1), legend.justification = c(1,1),
                              ^
```
[R/plot-survival.R:115:62:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L115) *style:* **Commas should always have a space after.**
```r
		      legend.position = c(1,1), legend.justification = c(1,1),
                                                             ^
```
[R/plot-survival.R:116:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L116) *style:* **Use spaces to indent, not tabs.**
```r
		      legend.title = element_text(size = theme_get()$legend.text$size),
^~
```
[R/plot-survival.R:117:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L117) *style:* **Use spaces to indent, not tabs.**
```r
		      legend.text = element_text(size = theme_get()$legend.text$size),
^~
```
[R/plot-survival.R:118:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L118) *style:* **Use spaces to indent, not tabs.**
```r
		      axis.line.x = element_blank(),
^~
```
[R/plot-survival.R:119:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L119) *style:* **Use spaces to indent, not tabs.**
```r
		      axis.line.y = element_blank(),
^~
```
[R/plot-survival.R:120:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L120) *style:* **Use spaces to indent, not tabs.**
```r
		      # panel.border = element_rect(size = .75, color = 'black', linetype = 'solid', fill = NA),
^~
```
[R/plot-survival.R:121:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L121) *style:* **Use spaces to indent, not tabs.**
```r
		      panel.background = element_rect(fill = NA),
^~
```
[R/plot-survival.R:122:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L122) *style:* **Use spaces to indent, not tabs.**
```r
		      plot.title = element_text(vjust = -1),
^~
```
[R/plot-survival.R:123:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L123) *style:* **Use spaces to indent, not tabs.**
```r
		      aspect.ratio = 1) +
^~
```
[R/plot-survival.R:124:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L124) *style:* **Use spaces to indent, not tabs.**
```r
		labs(x = x_lab, y = y_lab, color = legend_title) +
^~
```
[R/plot-survival.R:125:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L125) *style:* **Use spaces to indent, not tabs.**
```r
	    coord_cartesian(clip = 'off')
^
```
[R/plot-survival.R:127:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L127) *style:* **Use spaces to indent, not tabs.**
```r
	if (!is.null(interval)) {
^
```
[R/plot-survival.R:128:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L128) *style:* **Use spaces to indent, not tabs.**
```r
	    sf_plot = sf_plot +
^
```
[R/plot-survival.R:129:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L129) *style:* **Use spaces to indent, not tabs.**
```r
	        scale_x_continuous(expand = c(.01,0), limits = c(0, xmax), breaks = seq(0, xmax, interval))
^
```
[R/plot-survival.R:129:44:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L129) *style:* **Commas should always have a space after.**
```r
	        scale_x_continuous(expand = c(.01,0), limits = c(0, xmax), breaks = seq(0, xmax, interval))
                                           ^
```
[R/plot-survival.R:130:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L130) *style:* **Use spaces to indent, not tabs.**
```r
	} else {
^
```
[R/plot-survival.R:132:47:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L132) *style:* **Commas should always have a space after.**
```r
            scale_x_continuous(expand = c(.01,0), limits = c(0, xmax), breaks = scales::pretty_breaks(n = 4))
                                              ^
```
[R/plot-survival.R:133:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L133) *style:* **Use spaces to indent, not tabs.**
```r
	}
^
```
[R/plot-survival.R:135:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L135) *style:* **Use spaces to indent, not tabs.**
```r
	# Calculate p-value
^
```
[R/plot-survival.R:136:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L136) *style:* **Use spaces to indent, not tabs.**
```r
	if (pval & length(survfit_object$strata)>1) {
^
```
[R/plot-survival.R:136:42:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L136) *style:* **Put spaces around all infix operators.**
```r
	if (pval & length(survfit_object$strata)>1) {
                                        ~^~
```
[R/plot-survival.R:137:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L137) *style:* **Use spaces to indent, not tabs.**
```r
	    sf_call = as.character(survfit_object$call)
^
```
[R/plot-survival.R:138:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L138) *style:* **Use spaces to indent, not tabs.**
```r
	    sf_call = paste0(gsub('survfit', 'survdiff', sf_call[1]), '(', sf_call[2], ',data=', sf_call[3],')')
^
```
[R/plot-survival.R:138:102:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L138) *style:* **Commas should always have a space after.**
```r
	    sf_call = paste0(gsub('survfit', 'survdiff', sf_call[1]), '(', sf_call[2], ',data=', sf_call[3],')')
                                                                                ^
```
[R/plot-survival.R:139:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L139) *style:* **Use spaces to indent, not tabs.**
```r
	    sd = eval(parse(text = sf_call))
^
```
[R/plot-survival.R:140:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L140) *style:* **Use spaces to indent, not tabs.**
```r
	    pval = 1 - pchisq(sd$chisq, length(sd$n) - 1)
^
```
[R/plot-survival.R:141:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L141) *style:* **Use spaces to indent, not tabs.**
```r
	    if (pval <= 1e-03) { pval = scales::scientific_format(digits = 3)(pval) } else { pval = round(pval, 3) }
^
```
[R/plot-survival.R:141:25:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L141) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
	    if (pval <= 1e-03) { pval = scales::scientific_format(digits = 3)(pval) } else { pval = round(pval, 3) }
                        ^
```
[R/plot-survival.R:141:78:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L141) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
	    if (pval <= 1e-03) { pval = scales::scientific_format(digits = 3)(pval) } else { pval = round(pval, 3) }
                                                                             ^
```
[R/plot-survival.R:141:85:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L141) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
	    if (pval <= 1e-03) { pval = scales::scientific_format(digits = 3)(pval) } else { pval = round(pval, 3) }
                                                                                ^
```
[R/plot-survival.R:141:109:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L141) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
	    if (pval <= 1e-03) { pval = scales::scientific_format(digits = 3)(pval) } else { pval = round(pval, 3) }
                                                                                ^
```
[R/plot-survival.R:142:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L142) *style:* **Use spaces to indent, not tabs.**
```r
	    if (length(unique(sf$strata))==2) {
^
```
[R/plot-survival.R:142:35:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L142) *style:* **Put spaces around all infix operators.**
```r
	    if (length(unique(sf$strata))==2) {
                                 ~^~~
```
[R/plot-survival.R:143:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L143) *style:* **Use spaces to indent, not tabs.**
```r
	        cp_call = gsub('survdiff', 'coxph', sf_call)
^
```
[R/plot-survival.R:144:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L144) *style:* **Use spaces to indent, not tabs.**
```r
	        cp = eval(parse(text = cp_call))
^
```
[R/plot-survival.R:145:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L145) *style:* **Use spaces to indent, not tabs.**
```r
	        hr = round(exp(cp$coefficients), 2)
^
```
[R/plot-survival.R:146:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L146) *style:* **Use spaces to indent, not tabs.**
```r
	        big_n = cp$n
^
```
[R/plot-survival.R:147:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L147) *style:* **Use spaces to indent, not tabs.**
```r
	        pval = str_c('N=', big_n, '\nHR=', hr, '\nP-value ', pval)
^
```
[R/plot-survival.R:148:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L148) *style:* **Use spaces to indent, not tabs.**
```r
	    } else {
^
```
[R/plot-survival.R:149:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L149) *style:* **Use spaces to indent, not tabs.**
```r
	    	big_n = sum(survfit_object$n)
^~~~~~
```
[R/plot-survival.R:150:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L150) *style:* **Use spaces to indent, not tabs.**
```r
	    	pval = str_c('N=', big_n, '\nP-value ', pval)
^~~~~~
```
[R/plot-survival.R:151:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L151) *style:* **Use spaces to indent, not tabs.**
```r
	    }
^
```
[R/plot-survival.R:152:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L152) *style:* **Use spaces to indent, not tabs.**
```r
	    if (is.null(pval_pos)) { pval_x = 0; pval_y = 0 } else { pval_x = pval_pos[1]; pval_y = pval_pos[2] }
^
```
[R/plot-survival.R:152:29:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L152) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
	    if (is.null(pval_pos)) { pval_x = 0; pval_y = 0 } else { pval_x = pval_pos[1]; pval_y = pval_pos[2] }
                            ^
```
[R/plot-survival.R:152:54:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L152) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
	    if (is.null(pval_pos)) { pval_x = 0; pval_y = 0 } else { pval_x = pval_pos[1]; pval_y = pval_pos[2] }
                                                     ^
```
[R/plot-survival.R:152:61:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L152) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
	    if (is.null(pval_pos)) { pval_x = 0; pval_y = 0 } else { pval_x = pval_pos[1]; pval_y = pval_pos[2] }
                                                            ^
```
[R/plot-survival.R:152:106:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L152) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
	    if (is.null(pval_pos)) { pval_x = 0; pval_y = 0 } else { pval_x = pval_pos[1]; pval_y = pval_pos[2] }
                                                                                ^
```
[R/plot-survival.R:153:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L153) *style:* **Use spaces to indent, not tabs.**
```r
	    sf_plot = sf_plot + annotate('text', x = pval_x, y = pval_y, label = pval,
^
```
[R/plot-survival.R:154:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L154) *style:* **Use spaces to indent, not tabs.**
```r
	                                 size = rel(2.5), vjust = -.25, hjust = 0, family = 'ArialMT')
^
```
[R/plot-survival.R:155:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L155) *style:* **Use spaces to indent, not tabs.**
```r
	    if (all(legend_pos==0)) legend_pos = c(1,1); legend_just = c(1,1)
^
```
[R/plot-survival.R:155:24:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L155) *style:* **Put spaces around all infix operators.**
```r
	    if (all(legend_pos==0)) legend_pos = c(1,1); legend_just = c(1,1)
                      ~^~~
```
[R/plot-survival.R:155:47:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L155) *style:* **Commas should always have a space after.**
```r
	    if (all(legend_pos==0)) legend_pos = c(1,1); legend_just = c(1,1)
                                              ^
```
[R/plot-survival.R:155:69:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L155) *style:* **Commas should always have a space after.**
```r
	    if (all(legend_pos==0)) legend_pos = c(1,1); legend_just = c(1,1)
                                                                    ^
```
[R/plot-survival.R:156:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L156) *style:* **Use spaces to indent, not tabs.**
```r
	}
^
```
[R/plot-survival.R:158:1:](https://github.com/kpjonsson/kpjmisc/blob/e21e152ba3bf702aef474dd4ea35af379d207bc8/R/plot-survival.R#L158) *style:* **Use spaces to indent, not tabs.**
```r
	sf_plot = sf_plot +
^
```