>>>>> Bert Gunter >>>>> on Wed, 27 Oct 2021 10:47:14 -0700 writes:
> See ?load, but you may be confused. Strictly speaking, there is no code in > an .Rdata file, only a (typically binary, but possibly ascii) > representation of objects, usually as produced by ?save. Of course, > functions are also objects, so that if you load a file with functions, the > function code is available. > You can save and load command histories via ?savehistory, which, like ?save > and ?load can usually be accessed through any GUI interface that you are > using. > Warning: I believe the above is correct, but I may be wrong in at least > some details, so give others a chance to reply and possibly correct. > Cheers, > Bert > Bert Gunter In spite of really not recommending to work with .RData but rather with R *scripts* (or R Sweave / R markdown documents), an often forgotten considerably more flexible and in that sense better alternative to load() in such situations is attach() which creates an environment in which the objects are loaded and attaches that to the search() path. Example (from my current R console): > save.image() # creates .RData > attach(".RData") > ls.str(pos=2) logi : Named logi [1:3] FALSE NA TRUE Mlibrary : function (pkg, lib = NULL, check64.32 = TRUE, ...) ncF : int [1:5, 1:3] 5 6 2 1 15 5 6 2 1 15 ... nchars : function (x, ...) ncT : int [1:5, 1:3] 5 6 NA 1 15 5 6 NA 1 15 ... x : chr [1:5] "asfef" "qwerty" NA "b" "stuff.blah.yech" > So, indeed, ls.str() comes handy as well.. Best, Martin ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.