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 data.frame.

arg

An argument name in the current function.

call

The execution environment of a currently running function, e.g. call = caller_env(). The corresponding function call is retrieved and mentioned in error messages as the source of the error.

You only need to supply call when throwing a condition from a helper function which wouldn't be relevant to mention in the message.

Can also be NULL or a defused function call to respectively not display any call or hard-code a code to display.

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 type and name. Typically retrieved from the field metadata from a FeatureLayer or Table. Also can use the output of infer_esri_type().

Details

Field type mapping:

Esri field types are mapped as

R types are mapped as

Value

Examples


get_ptype("esriFieldTypeDouble")
inferred <- infer_esri_type(iris)
ptype_tbl(inferred)


[Package arcgisutils version 0.3.0 Index]