Registration of custom column types and parsers #865
This is a feature request that should not impact current
Consider the cases in which a rectangular data source contains, e.g.,
readr::read_csv(" quantity,point 1.53(3) m/s,\"POINT(0,1)\" 5.21(1) m/s,\"POINT(1,5)\" ") #> # A tibble: 3 x 2 #> quantity point #> <chr> <chr> #> 1 quantity point #> 2 1.53(3) m/s POINT(0,1) #> 3 5.21(1) m/s POINT(1,5)
Currently, those data types are read as character (and other use cases may be stripped to numbers), and the user needs to convert them. The idea would be to allow packages to register custom column types and parsers into
I could be missing something, but the general changes needed for this would be:
The only drawback I can think of is that a package may, e.g., register a parser that catches everything and messes things up. To avoid this issue,
If this enhancement is considered, I would be more than happy to work on it.
The text was updated successfully, but these errors were encountered:
I'll second this! Would be very welcome if we could extend the functionality of
Our AMR package is all about antimicrobial resistance (AMR). The new class
Consider this third-ed !
With col_types, extend the abbreviation string assignment to allow users to instead use the key for their input parser.