Check out ?dump. For example:
?dump
newEnv <- new.env()load("myFunctions.Rdata", newEnv)dump(c(lsf.str(newEnv)), file="normalCodeFile.R", envir=newEnv)
You may also be interested in ?prompt (which creates documentation files for objects) and / or ?package.skeleton.
?prompt
?package.skeleton
This recent blog post addresses a basically the same problem:
http://www.r-statistics.com/2010/09/dumping-functions-from-the-global-environment-into-an-r-script-file/
There's another solution from another post using sink
sink
sink(file="Function.R")Function # The objectsink()