The following script runs in R console but when run in bash terminal using the Rscript command it throws the error below the code.
libs = c("openxlsx", "biomaRt", "stringr", "yaml")
invisible(suppressPackageStartupMessages(lapply(libs, require, character.only=TRUE)))