Skip to content

Commit

Permalink
Merge branch '12/crashfix' of https://github.com/thercast/CRANsearcher
Browse files Browse the repository at this point in the history
…into thercast-12/crashfix
  • Loading branch information
bzkrouse committed Oct 2, 2017
2 parents 724770b + 8f18a8b commit d409fcf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/CRANsearcher.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,16 @@ CRANsearcher <- function(){
if(identical(search_d(), character(0)) || nchar(search_d())<2){
s <- 0
} else{

s <- a %>%
mutate(term = tolower(paste(name, Title, Description, sep=","))) %>%
rowwise %>%
mutate(match = all(stringr::str_detect(term, search2))) %>%
filter(match==TRUE) %>%
select(-c(term, match)) %>%
data.frame

if (nrow(s) == 0) s <- 0
}
return(s)
})
Expand Down Expand Up @@ -189,6 +192,9 @@ CRANsearcher <- function(){
return()
}
} else{
validate(
need(a_sub2() != 0, "Your search returned no results. Please try again.")
)
DT::datatable(a_sub2()[,c(1:6)],
rownames = FALSE,
escape = FALSE,
Expand Down Expand Up @@ -223,6 +229,7 @@ CRANsearcher <- function(){
paste("")
}
} else{
req(a_sub2() != 0)
n <- dim(a_sub2())[1]

if (!n==1){
Expand Down

0 comments on commit d409fcf

Please sign in to comment.