@@ -43,7 +43,7 @@ annotate_repostitle <- function(string_og) {
43
43
.data $ repo == " Bioconductor" ~ " Bioconductor" ,
44
44
.data $ repo == " RSPM" ~ " Posit RPSM" ,
45
45
.data $ repo == " none" ~ " not installed on this machine" ,
46
- str_detect(.data $ repo ," universe" )~ .data $ repo ,# for Runiverse pkgs
46
+ stringr :: str_detect(.data $ repo ," universe" )~ .data $ repo ,# for Runiverse pkgs
47
47
TRUE ~ repo_details(.data $ pkgname_clean )
48
48
), annotation = dplyr :: case_when(stringr :: str_detect(
49
49
user_repo ,
@@ -53,8 +53,10 @@ annotate_repostitle <- function(string_og) {
53
53
54
54
# build annotations
55
55
if (all(! grepl(" p_load" , pck_descs $ call ))) { # no pacman calls
56
- pck_descs $ annotated <- paste0(pck_descs $ call , " # " , pck_descs $ title , " , " , pck_descs $ annotation , " v" , pck_descs $ version )
57
-
56
+ pck_descs <- dplyr :: mutate(pck_descs ,annotated = dplyr :: case_when(
57
+ stringr :: str_detect(title ," not installed" )~ paste0(call , " # " , annotation , " vNA" ),
58
+ TRUE ~ paste0(call , " # " , title , " " , annotation , " v" , version )
59
+ ))
58
60
return (
59
61
stringi :: stri_replace_all_fixed(
60
62
str = string_og , pattern = pck_descs $ call ,
@@ -64,7 +66,7 @@ annotate_repostitle <- function(string_og) {
64
66
}
65
67
66
68
if (all(grepl(" p_load" , pck_descs $ call ))) { # only pacman calls
67
- pacld <- pck_descs [which(stringr :: str_detect(out_tb $ call , " .+load\\ (" )), ]
69
+ pacld <- pck_descs [which(stringr :: str_detect(pck_descs $ call , " .+load\\ (" )), ]
68
70
pacld $ pkgnamesep <- paste0(pacld $ package_name , " , " )
69
71
pacld <- dplyr :: mutate(dplyr :: group_by(pacld , call ), pkgnamesep = ifelse(dplyr :: row_number() == dplyr :: n(), gsub(" ," , " " , .data $ pkgnamesep ), .data $ pkgnamesep ))
70
72
pacld $ annotatedpac <- paste0(pacld $ pkgnamesep , " # " , pacld $ title , " " , pacld $ annotation , " v" , pacld $ version )
@@ -80,7 +82,7 @@ annotate_repostitle <- function(string_og) {
80
82
}
81
83
82
84
if (any(grepl(" p_load" , pck_descs $ call )) & any(grepl(" libr|req" , out_tb $ call ))) { # pacman and base calls
83
- pacld <- pck_descs [which(stringr :: str_detect(out_tb $ call , " .+load\\ (" )), ]
85
+ pacld <- pck_descs [which(stringr :: str_detect(pck_descs $ call , " .+load\\ (" )), ]
84
86
pacld $ pkgnamesep <- paste0(pacld $ package_name , " , " )
85
87
pacld <- dplyr :: mutate(dplyr :: group_by(pacld , call ), pkgnamesep = ifelse(dplyr :: row_number() == dplyr :: n(), gsub(" ," , " " , .data $ pkgnamesep ), .data $ pkgnamesep ))
86
88
pacld $ annotatedpac <- paste0(pacld $ pkgnamesep , " # " , pacld $ title , " " , pacld $ annotation , " v" , pacld $ version )
@@ -91,8 +93,11 @@ annotate_repostitle <- function(string_og) {
91
93
str = string_og , pattern = pacld $ call ,
92
94
replacement = pacld $ annotpac , vectorize_all = FALSE
93
95
)
94
- pck_descs <- pck_descs [! stringr :: str_detect(out_tb $ call , " .+load\\ (" ), ]
95
- pck_descs $ annotated <- paste0(pck_descs $ call , " # " , pck_descs $ title , " " , pck_descs $ annotation , " v" , pck_descs $ version )
96
+ pck_descs <- pck_descs [which(! stringr :: str_detect(pck_descs $ call , " .+load\\ (" )), ]
97
+ pck_descs <- dplyr :: mutate(pck_descs ,annotated = dplyr :: case_when(
98
+ stringr :: str_detect(title ," not installed" )~ paste0(call , " #" , " " , annotation , " vNA" ),
99
+ TRUE ~ paste0(call , " # " , title , " " , annotation , " v" , version )
100
+ ))
96
101
97
102
return (
98
103
stringi :: stri_replace_all_fixed(
0 commit comments