grep_objects | R Documentation |
search for saved R objects
grep_objects( grep_string = ".", save_date = ".", objects_path = jamsession_paths()$objects, ignore.case = TRUE, return_df = TRUE, most_recent = TRUE, add_stats = FALSE, verbose = FALSE, ... )
grep_string |
|
save_date |
|
objects_path |
character vector of one or more file paths to
search for saved R objects. When |
ignore.case |
|
return_df |
|
most_recent |
logical whether to return only the most recent
saved version of each matching object, by default |
add_stats |
|
verbose |
logical whether to print verbose output |
... |
additional arguments are passed to |
This function searches for saved R objects using one or more text or regular expression patterns.
It is possible to supply multiple file paths using the
argument objects_path
, in which case all objects are returned
for all directories, then they are sorted by save_date
.
The input objects_path
is stored as an ordered factor, such
that two files with the same save_date
will still be ordered
consistent with the input directories in objects_path
.
In this case, when most_recent=TRUE
there will be one entry
returned per object
name, and the first entry will be the
most recent entry ordered by objects_path
.
In practice, it is recommended to use one objects_path
location, but this option exists.
For example, load_object(grep_objects("my_favorite_object"))
will load the most recent object by save_date
where any
ties prefer the order in objects_path
. Similarly,
load_object("my_favorite_object")
does the same thing,
without the grep_patten search step.
See save_object()
for examples.
data.frame
when return_df=TRUE
; character vector
when return_df=FALSE
. The returned data will contain object
names that match the grep_string
input.
Other jamsession objects:
list_objects()
,
load_object()
,
save_object()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.