Compares the current version of two scripts against one another. The output will appear in the viewer and only rows where there have been additions, deletions or modifications in the script will be shown.

This should be used when a new script has been created based off an existing script.

diffFiles(
  .file_1,
  .file_2,
  .banner_1 = NULL,
  .banner_2 = NULL,
  .side_by_side = TRUE,
  .ignore_white_space = FALSE,
  .display_entire_file = FALSE
)

Arguments

.file_1

file path of first file from working directory

.file_2

file path of second file from working directory

.banner_1

Header for first file in viewer

.banner_2

Header for second file in viewer

.side_by_side

Logical. Should diffs be displayed side by side?

.ignore_white_space

Logical. Should white space be ignored?

.display_entire_file

Logical. Should the entire file be displayed?

Examples

with_demoRepo({
 diffFiles(.file_1 = "script/data-assembly.R", 
           .file_2 = "script/combine-da.R")
})
#> < data-assembly.R                        > combine-da.R                         
#> @@ 1,10 @@                               @@ 1,6 @@                              
#>   library(tidyverse)                       library(tidyverse)                   
#> < source(here::here("script", "data-ass  > studies <- list()                    
#> : embly", "da-functions.R"))             ~                                      
#> < src_abc <- mrgda::read_src_dir(here::  > studies$pk_abc <- readr::read_rds(her
#> : here("data", "source", "STUDY-ABC"))   : e::here("data", "derived", "studies",
#> ~                                        :  "pk-abc.rds"))                      
#> < derived <- list(sl = list(),tv = list  ~                                      
#> : ())                                    ~                                      
#> < dm_0 <- src_abc$dm %>% filter(ACTARM   ~                                      
#> : != "Screen Failure")                   ~                                      
#> < derived$sl$dm <- dm_0                  ~                                      
#> < pk_0 <- src_abc$pc %>% filter(PCTEST   > pk_0 <- bind_rows(studies) %>% arrang
#> : == "TEST OF INTEREST")                 : e(USUBJID, DATETIME)                 
#> < derived$tv$pc <- pk_0                  > pk_1 <- pk_0 %>% mrgda::assign_id(., 
#> ~                                        : "USUBJID")                           
#> < ex_1 <- src_abc$ex %>% filter(EXTRT =  > pk_out <- pk_1                       
#> : = "DRUG OF INTEREST")                  ~                                      
#> < derived$tv$dosing <- ex_1              ~