Skip to contents

return data.frame with formatted fields

Usage

obs_format(
  dt,
  spf = c("month", "day", "hour", "minute", "second", "month_end", "day_end", "hour_end",
    "minute_end", "second_end"),
  spffmt = "%02d",
  rnd = c("latitude", "longitude"),
  rndn = 4,
  spfrnd = TRUE,
  out,
  ...
)

Arguments

dt

`data.table`

spf

columns to be formatted with `sprintf`

spffmt

format to be applied to spf

rnd

columns to be round

rndn

Round number to be applied to `rnd`

spfrnd

Logical, sprintf `rnd` columns after being round ?

out

outfile path used by data.table::fwrite.

...

data.table::fwrite arguments.

Note

source https://stackoverflow.com/a/47015304/2418532

Examples

if (FALSE) { # \dontrun{
# do not run
} # }