The below code shows how to configure the repos option in R such that install.packages() etc. will locate the packages without having to explicitly specify the repository. Just add it to the .Rprofile file in your home directory (iff missing, create it). For more details, see help("Startup").

local({
repos <- getOption("repos")

# http://cran.r-project.org/
# For a list of CRAN mirrors, see getCRANmirrors().
repos["CRAN"] <- "http://cran.stat.ucla.edu"