alpha.replace <- function(from, to){ script <- c("substitute({",readLines(),"}, list(",from,"=quote(",to,")))") eval(parse(text=script)) }