Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nchar as arguement to writeZarrArray #15

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

Artur-man
Copy link

Missing nchar gives error with text array

> mat <- array(rep("text",231145), dim = c(231145))
> path_to_new_zarr <- file.path("data/string_test.zarr")
> writeZarrArray(x = mat, zarr_array_path = path_to_new_zarr, chunk_dim = c(10000))
Error in .check_datatype(data_type = data_type, fill_value = fill_value,  : 
  The 'nchar' argument must be provided and be a positive integer

however now:

> writeZarrArray(x = mat, zarr_array_path = path_to_new_zarr, chunk_dim = c(10000), nchar = 4)
<231145> ZarrArray object of type "character":
[1]      [2]      [3]      .        [231144] [231145] 
  "text"   "text"   "text"        .       ""       "" 

I am not sure about the empty text at the tail though but it seems the issue occurs with numeric values too

> mat <- array(rep(1,231145), dim = c(231145))
> path_to_new_zarr <- file.path("data/string_test.zarr")
> writeZarrArray(x = mat, zarr_array_path = path_to_new_zarr, chunk_dim = c(10000), nchar = 4)
<231145> ZarrArray object of type "double":
     [1]      [2]      [3]        . [231144] [231145] 
       1        1        1        .        0        0 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant