#load dataset (will need to how own working directory path) setwd("C:/Users/Mark.Williamson.2/Desktop/Williamson Data/R/R_data") pack_list <-read.csv("R_packages.csv") head(pack_list) #search function ##enter a term in quotes ##can be multiple words pack_search <-function(term) { term2 <-tolower(term) for (i in 1:length(pack_list$Name)){ d_lower <-tolower(pack_list$Description[i]) hit <- grepl(term2, d_lower) if (hit){ n <-pack_list$Name[i] d <-pack_list$Description[i] print(paste(n,d,sep=" -----> ")) } } } #examples pack_search("generalized linear mixed") pack_search("power analysis") pack_search("Bayesian") pack_search("xkcd") pack_search("dragon")