A cr_path_spec holds everything needed to recover design facts from
where a file sits and what it is called: the meaning of each directory
level, the file-name grammar, the marker rules and whether an
unparseable name is an error.
Usage
cr_path_spec(levels = NULL, grammar = NULL, markers = NULL, strict = TRUE)
# S3 method for class 'cr_path_spec'
print(x, ...)Arguments
- levels
Either an unnamed character vector naming the directory levels below the root in order (use
NAor""to skip a level), or a named integer vector mapping column names to level indices, where negative indices count back from the file (-1is the directory containing the file).- grammar
A
cr_filename_grammar(), orNULL.- markers
A
cr_marker_rules()object, orNULL.- strict
Logical. Treat a file name that does not match the grammar as an error. Default
TRUE.- x
A
cr_path_spec.- ...
Ignored.
See also
cr_parse_paths(), cr_read_exports().
Other import:
cr_assign_units(),
cr_centroid_overlap(),
cr_column_map(),
cr_extract_markers(),
cr_filename_grammar(),
cr_marker_rules(),
cr_merge_rules(),
cr_parse_paths(),
cr_read_cellprofiler(),
cr_read_cells(),
cr_read_design(),
cr_read_export(),
cr_read_exports(),
cr_read_qupath(),
cr_read_segmantr(),
cr_unit_map()
Examples
spec <- cr_path_spec(
levels = c(run = 1L, compound = 2L, plate = -1L),
grammar = cr_filename_grammar(
tokens = list(interval = "[0-9]+min", dose = "[0-9]+uM")
),
markers = cr_marker_rules(merge_unit = "\\(split\\)")
)
spec
#> <cr_path_spec>
#> • levels: run[1] / compound[2] / plate[-1]
#> • grammar tokens: interval, dose
#> • markers: set
#> • strict: TRUE