tryCatch(
{ # in case offline
link1 <- "https://gist.githubusercontent.com/seankross/"
link2 <- "a412dfbd88b3db70b74b/raw/5f23f993cd87c283ce766e7ac6b329ee7cc2e1d1/mtcars.csv"
file <- paste0(link1, link2)
awkHelper(file, list("gear in 4, 3"), awk = NULL)
awkHelper(file, "gear contains 3", awk = NULL)
# note that to be filtered the file has to exist on your local system, this example only shows
# the output of awkHelper, which would then be executed by read.pcv on a unix system
awkHelper(file, list("gear in 4, 3"), awk = "existing_command")
},
error = function(e) {
message(e)
}
)
Run the code above in your browser using DataLab