Returns a ReadOnlyChainDaf that reads from daf but rejects
writes; there is no separate read-only wrapper class. As in Julia,
read_only is the identity on data that is already read-only: if
daf is a DafReadOnly and no name is given, daf itself is
returned; passing a name always forces a fresh wrapper.
Value
daf itself if it is already read-only and name is
NULL; otherwise a ReadOnlyChainDaf.
Examples
d <- memory_daf(name = "inner")
add_axis(d, "cell", c("c1", "c2"))
ro <- read_only(d)
daf_name(ro)
#> [1] "inner"
identical(read_only(ro), ro)
#> [1] TRUE