Skip to content

Error in writing character arrays with arbitrary size #112

@Artur-man

Description

@Artur-man

Describe the bug

There seems to be an error when writing zarr arrays with character elements and arbitrary shape. I traced it here by debugging but couldn't really figure out:

https://github.com/keller-mark/pizzarr/blob/f84355d2708c22dc6e703f3cdd83d218221b352a/R/zarr-array.R#L633-L648

To Reproduce

mat <- array(rep("text", 545*689), dim = c(545, 689))
zarr.array <- pizzarr::zarr_open(store = "data/string_test.zarr", mode = "w")
zarr.array$create_dataset(name = "assay", data = mat, shape = dim(mat), dtype = "<S20")

Error

Error in buf[offset_i_start:offset_i_stop] <- raw_vec_i : 
  replacement has length zero

Environment:

  • Release or git hash: f84355d
  • Operating system: macOS Monterey v12.5.1
  • R version: 4.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions