R/gsr.R

gsr <-
function(file, search, replace) { 
  if (length(search) != length(replace)) stop("The object search and replace must have the same number of items \n")
changing <- as.character(file)

  for (i in 1:length(search)) 
  { 
    cat("Replacing: ", search[i], " with: ", replace[i], "\n")  
	changed <- replace(changing, changing == search[i], replace[i])}
  
	cat("\n")   
  return(changed)
}

Try the SciencePo package in your browser

Any scripts or data that you put into this service are public.

SciencePo documentation built on May 2, 2019, 5:53 p.m.