# Supported Zarr features in Rarr

## Zarr version

Support for Zarr version 3 is actively being worked on, and some features are likely to be missing.

It is known that the sharding codec is not yet implemented.

## Reading and Writing

Reading Zarr arrays is reasonably well supported. Writing is available, but is more limited. Both aspects are under active development.

### Stores

Store Type | Status (reading / writing) | Notes
--- | --- | ---
`FilesystemStore` | ✔ / ✔ |
`S3Store` | ✔ / ❌ |

### Data Types

Currently there is only support for reading and writing a subset of the possible datatypes that can be found in a Zarr array. In some instances there are also limitations on the datatypes natively supported by R, requiring conversion from the Zarr datatype. The table below summarises the current status of datatype support. It will be updated as progress is made.

Zarr Data Type | Status (reading / writing) | Notes
--- | --- | ---
`boolean` | ✔ / ✔ |
`int8` | ✔ / ✔ |
`uint8` | ✔ / ✔ |
`int16` | ✔ / ✔ |
`uint16` | ✔ / ✔ |
`int32` | ✔ / ✔ |
`uint32` | ✔ / ✔ | Values outside the range of `int32` are converted to `NA`. Future plan is to allow conversion to `double` or use the bit64 package.
`int64` | ✔ / ✔ | Values outside the range of `int32` are converted to `NA`. Future plan is to allow conversion to `double` or use the bit64 package.
`uint64` | ✔ / ✔ | Values outside the range of `int32` are converted to `NA`. Future plan is to allow conversion to `double` or use the bit64 package.
`half` / `float16` | ✔ / ❌ | Converted to `double` in R. No effort is made to assess loss of precision due to conversion.
`single` / `float32` | ✔ / ✔ | Converted to `double` in R. No effort is made to assess loss of precision due to conversion.
`double` / `float64` | ✔ / ✔ |
`complex` | ❌ / ❌ |
`timedelta` | ❌ / ❌ |
`datetime` | ❌ / ❌ |
`string` | ✔ / ✔ |
`Unicode` | ✔ / ✔ |
`void *` | ❌ / ❌ |
Structured data types | ✔ / ❌ | Only one level of nesting and no arrays for now.

### Codecs

#### Compression codecs

Library | Status (reading / writing) | Notes
--- | --- | ---
`zlib / gzip` | ✔ / ✔ | Only system default compression level (normally 6) is enabled for writing.
`bzip2` | ✔ / ✔ | Only compression level 9 is enabled for writing.
`blosc` | ✔ / ✔ | Only `lz4` compression level 5 is enabled for writing.
`LZMA` | ✔ / ✔ |
`LZ4` | ✔ / ✔ |
`Zstd` | ✔ / ✔ |

Please open an issue if support for a required compression codec is missing.

#### Other codecs

Codec | Status (reading / writing) | Notes
--- | --- | ---
`endian` | ✔ / ❌ |
`transpose` | ✔ / ✔ |
`VLen-UTF8` | ✔ / ✔ * | Writing supported only via `update_zarr_array()`

### Optional fields or features

Feature | Status (reading / writing) | Notes
--- | --- | ---
`dimension_names` | ✔ / ✔ | Corresponds to `names(dimnames(x))` in R