[R] Error when trying to create a dictionary from character column
Open
Component: R
Type: bug
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
### Describe the bug, including details regarding any error messages, version, and platform.
``` r
library(arrow)
#>
#> Attaching package: 'arrow'
#> The following object is masked from 'package:utils':
#>
#> timestamp
df <- tibble::tibble(x = c("hi", "I'm", "a", "string"))
arrow_table(df)
#> Table
#> 4 rows x 1 columns
#> $x
arrow_table(df, schema = schema(x = dictionary()))
#> Error: Invalid: invalid R type to convert to dictionary
```
It works if I call `as.factor` on the character column when it's being created; perhaps we can just pop an `as.factor()` in if the input type is a character rather than a factor?
### Component(s)
R
Contributor guide
Assessment
This issue has not been assessed yet.