infer_esri_type {arcgisutils} | R Documentation |
Esri field type mapping
Description
Infers Esri field types from R objects.
Usage
infer_esri_type(
.data,
arg = rlang::caller_arg(.data),
call = rlang::caller_env()
)
get_ptype(field_type, n = 1, call = rlang::caller_env())
ptype_tbl(fields, n = 0, call = rlang::caller_env())
remote_ptype_tbl(fields, call = rlang::caller_env())
Arguments
.data |
an object of class |
arg |
An argument name in the current function. |
call |
The execution environment of a currently running
function, e.g. You only need to supply Can also be For more information about error calls, see Including function calls in error messages. |
field_type |
a character of a desired Esri field type. See details for more. |
n |
the number of rows to create in the prototype table |
fields |
a data.frame containing, at least, the columns |
Details
-
get_ptype()
takes a scalar character containing the Esri field type and returns a prototype of the pertinent R type -
infer_esri_type()
takes a data frame-like object and infers the Esri field type from it. -
remote_ptype_tbl()
takes a data frame of fields as derived fromlist_fields()
and creates a lazy table proto type intended to be used withdbplyr
integration
Field type mapping:
Esri field types are mapped as
-
esriFieldTypeSmallInteger
: integer -
esriFieldTypeSingle
: double -
esriFieldTypeGUID
: integer -
esriFieldTypeOID
: integer -
esriFieldTypeInteger
: integer -
esriFieldTypeBigInteger
: double -
esriFieldTypeDouble
: double -
esriFieldTypeString
: character -
esriFieldTypeDate
: date
R types are mapped as
-
double
: esriFieldTypeDouble -
integer
: esriFieldTypeInteger -
character
: esriFieldTypeString -
date
: esriFieldTypeDate -
raw
: esriFieldTypeBlob
Value
-
get_pytpe()
returns an object of the class of the prototype. -
ptype_tbl()
takes adata.frame
with columnsname
andtype
and creates an emptydata.frame
with the corresponding columns and R types -
remote_ptype_tbl()
provides the results ofptype_tbl()
as a lazy data frame from thedbplyr
package. -
infer_esri_ptype()
returns adata.frame
with columnsname
,type
,alias
,nullable
, andeditable
columnsThis resembles that of the
fields
returned by a FeatureService
Examples
get_ptype("esriFieldTypeDouble")
inferred <- infer_esri_type(iris)
ptype_tbl(inferred)