Reputation: 167
I would like to find specific object (data) in the mutiple .RData by linux (Ubuntu).
For example, I have some of .RData, and I want to find object name include "max" (so... max_1, max_2, ... in the .RData).
As I had no idea what the RData has specific object (data), I want to check multiple .RData whether .RData has a certain object (data).
Moreover, I want to do this in the linux (Ubuntu) environment.
Please let me know how to do this.
Thank you advanced.
Upvotes: 1
Views: 749
Reputation: 6222
Maybe try this in R console. This will give you all the available object whose names starts with "max".
files <- dir()
rdata_files <- files[grepl(".RData", files)]
rdata_files
for (fname in rdata_files) {
obj_names <- load(fname)
cat(fname, "\n")
print(obj_names[grepl("^max", obj_names)])
}
Upvotes: 2