mudata_prepare_column: Prepare mudata table columns for writing

View source: R/mudata-io.R

mudata_prepare_columnR Documentation

Prepare mudata table columns for writing

Description

This set of generics is similar to output_column in that it converts columns to a form suitable to writing. mudata_prepare_column in combination with is intended to be opposites with mudata_parse_column except for date/time vectors that are not in UTC (mudata_parse_column assumes UTC, and mudata_prepare_column always converts to UTC with a message).

Usage

mudata_prepare_column(x, format = NA, ...)

mudata_prepare_tbl(x, format = NA, ...)

## Default S3 method:
mudata_prepare_tbl(x, format = NA, ...)

## S3 method for class 'tbl'
mudata_prepare_tbl(x, format = NA, ...)

## S3 method for class 'data.frame'
mudata_prepare_tbl(x, format = NA, ...)

## Default S3 method:
mudata_prepare_column(x, format = NA, ...)

## S3 method for class 'POSIXt'
mudata_prepare_column(x, format = NA, ...)

## S3 method for class 'sfc'
mudata_prepare_column(x, format = NA, ...)

## S3 method for class 'hms'
mudata_prepare_column(x, format = NA, ...)

## S3 method for class 'list'
mudata_prepare_column(x, format = NA, ...)

mudata_parse_column(x, type_str = NA_character_, ...)

mudata_parse_tbl(x, type_str = NA_character_, ...)

Arguments

x

A an object

format

csv, json, or NA for unknown,

...

Passed to methods

type_str

A type string, generated by the internal generate_type_str

Details

Type strings are currently internal, and are in the columns table in the "type" column. They are usually one of "character", "date", "datetime", "double", "integer", "json", and "wkt". They can also contain simple arguments, like "wkt(epsg=4326)" (actually, "wkt" is the only type string that should have arguments). You should generally not mess with these (in fact, the "type" column in the coluns table is overwritten right before read by default, so it is hard to mess this up).

Value

An atomic vector


paleolimbot/mudata documentation built on Oct. 3, 2023, 10:03 a.m.