|
6 | 6 | #' |
7 | 7 | #' @param df A data frame. |
8 | 8 | #' @return List object describing a Table Schema. |
| 9 | +#' @family create functions |
9 | 10 | #' @export |
10 | 11 | #' @section Table schema properties: |
11 | 12 | #' The Table Schema will be created from the data frame columns: |
|
14 | 15 | #' - `title`: not set. |
15 | 16 | #' - `description`: not set. |
16 | 17 | #' - `type`: contains the converted column type (see further). |
17 | | -#' - `format`: not set and can thus be considered `default`. This is also the |
18 | | -#' case for dates, times and datetimes, since [readr::write_csv()] used by |
19 | | -#' [write_package()] will format those to ISO8601 which is considered the |
20 | | -#' default. Datetimes in local or non-UTC timezones will be converted to UTC |
21 | | -#' before writing. |
| 18 | +#' - `format`: not set and can thus be considered `default`. |
| 19 | +#' This is also the case for dates, times and datetimes, since |
| 20 | +#' [readr::write_csv()] used by [write_package()] will format those to ISO8601 |
| 21 | +#' which is considered the default. |
| 22 | +#' Datetimes in local or non-UTC timezones will be converted to UTC before |
| 23 | +#' writing. |
22 | 24 | #' - `constraints`: not set, except for factors (see further). |
23 | | -#' - `missingValues`: not set. [write_package()] will use the default `""` for |
24 | | -#' missing values. |
| 25 | +#' - `missingValues`: not set. |
| 26 | +#' [write_package()] will use the default `""` for missing values. |
25 | 27 | #' - `primaryKey`: not set. |
26 | 28 | #' - `foreignKeys`: not set. |
27 | 29 | #' |
|
30 | 32 | #' The column type will determine the field `type`, as follows: |
31 | 33 | #' |
32 | 34 | #' - `character` → |
33 | | -#' [string](https://specs.frictionlessdata.io/table-schema/#string). |
| 35 | +#' [string](https://specs.frictionlessdata.io/table-schema/#string). |
34 | 36 | #' - `Date` → [date](https://specs.frictionlessdata.io/table-schema/#date). |
35 | 37 | #' - `difftime` → |
36 | | -#' [number](https://specs.frictionlessdata.io/table-schema/#number). |
| 38 | +#' [number](https://specs.frictionlessdata.io/table-schema/#number). |
37 | 39 | #' - `factor` → |
38 | | -#' [string](https://specs.frictionlessdata.io/table-schema/#string) with factor |
39 | | -#' levels as `enum`. |
| 40 | +#' [string](https://specs.frictionlessdata.io/table-schema/#string) with |
| 41 | +#' factor levels as `enum`. |
40 | 42 | #' - [hms::hms()] → |
41 | | -#' [time](https://specs.frictionlessdata.io/table-schema/#time). |
| 43 | +#' [time](https://specs.frictionlessdata.io/table-schema/#time). |
42 | 44 | #' - `integer` → |
43 | | -#' [integer](https://specs.frictionlessdata.io/table-schema/#integer). |
| 45 | +#' [integer](https://specs.frictionlessdata.io/table-schema/#integer). |
44 | 46 | #' - `logical` →. |
45 | | -#' [boolean](https://specs.frictionlessdata.io/table-schema/#boolean). |
| 47 | +#' [boolean](https://specs.frictionlessdata.io/table-schema/#boolean). |
46 | 48 | #' - `numeric` → |
47 | | -#' [number](https://specs.frictionlessdata.io/table-schema/#number). |
| 49 | +#' [number](https://specs.frictionlessdata.io/table-schema/#number). |
48 | 50 | #' - `POSIXct`/`POSIXlt` → |
49 | | -#' [datetime](https://specs.frictionlessdata.io/table-schema/#datetime). |
| 51 | +#' [datetime](https://specs.frictionlessdata.io/table-schema/#datetime). |
50 | 52 | #' - Any other type → |
51 | | -#' [any](https://specs.frictionlessdata.io/table-schema/#any). |
| 53 | +#' [any](https://specs.frictionlessdata.io/table-schema/#any). |
52 | 54 | #' @examples |
53 | 55 | #' # Create a data frame |
54 | 56 | #' df <- data.frame( |
|
0 commit comments