| as_fields | R Documentation |
Infers Esri field types from R objects. Use as_fields() to create a
data.frame of valid Esri Field Types
from an sf object or data.frame.
as_fields(.data, arg = rlang::caller_arg(.data), call = rlang::caller_env())
infer_esri_type(
.data,
arg = rlang::caller_arg(.data),
call = rlang::caller_env()
)
fields_as_ptype_df(fields, n = 0, call = rlang::caller_env())
ptype_tbl(fields, n = 0, call = rlang::caller_env())
.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. |
fields |
a list or data.frame of field types. Requires the fields |
n |
the number of rows to create in the prototype table |
as_fields() takes a data frame-like object and infers the Esri field type from it.
fields_as_pytpe_df() takes a list with type and name and creates an empty data.frame with the corresponding column names and types.
get_ptype() takes a scalar character containing the Esri field type and returns a prototype of the pertinent R type
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
fields_as_ptype_df() takes a data.frame with columns name and type and creates an empty data.frame with the corresponding columns and R types
as_fields() returns a data.frame with columns name, type, alias, nullable, and editable columns
This resembles that of the fields returned by a FeatureService
inferred <- as_fields(iris)
inferred
fields_as_ptype_df(inferred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.