In some cases the guessing API might not return what you want:
tib_unspecified() because the field is always NULL or absent -> the field could be anything
tib_unspecified() because the field is always NULL, absent or an empty list -> the field could be tib_vector(input_form != "vector"), tib_row() or tib_df()
tib_df(.names_to = "...") could also be tib_object() (tspec_guess() should prefer tib_df() as it produces the shorter spec)
tib_vector(input_form = "object") could also be tib_object() (tspec_guess() should prefer tib_vector() as it produces the shorter spec)
The guess_*() functions should be smarter about this. Add argument unspecified which can be one of:
In some cases the guessing API might not return what you want:
tib_unspecified()
because the field is alwaysNULL
or absent -> the field could be anythingtib_unspecified()
because the field is alwaysNULL
, absent or an empty list -> the field could betib_vector(input_form != "vector")
,tib_row()
ortib_df()
tib_df(.names_to = "...")
could also betib_object()
(tspec_guess()
should prefertib_df()
as it produces the shorter spec)tib_vector(input_form = "object")
could also betib_object()
(tspec_guess()
should prefertib_vector()
as it produces the shorter spec)The
guess_*()
functions should be smarter about this. Add argumentunspecified
which can be one of:"ask"
: ask the user immediately what to do"unspecified"
: keep them as unspecified"known"
: add them to the known fieldsand argument
ambiguous
"ask"
: ask the user immediately what to do"inform"
: choose one and inform