Parse a NumPy Array-protocol type strings
Value
A list containing the parsed data type information, including the base type, the number of bytes, and the endianness
Examples
parse_npy_datatype(">i8")
#> $base_type
#> [1] "int"
#>
#> $nbytes
#> [1] 8
#>
#> $endian
#> [1] "big"
#>
parse_npy_datatype("|b1")
#> $base_type
#> [1] "bool"
#>
#> $nbytes
#> [1] 1
#>
#> $endian
#> [1] NA
#>
parse_npy_datatype(list(c("r", "<i8"), c("g", "<i8"), c("b", "<i8")))
#> $base_type
#> [1] "int" "int" "int"
#>
#> $nbytes
#> [1] 8 8 8
#>
#> $endian
#> [1] "little" "little" "little"
#>