Skip to content

Commit 1723012

Browse files
committed
update roxygen and re-upload to cran
1 parent 4b099f8 commit 1723012

19 files changed

+609
-935
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: tableschema.r
22
Type: Package
33
Title: Table Schema 'Frictionless Data'
4-
Version: 1.1.2
4+
Version: 1.1.3
55
Date: 2022-09-29
66
Authors@R: c(person("Kleanthis", "Koupidis", email = "koupidis@okfn.gr", role = c("aut", "cre")),
77
person("Lazaros", "Ioannidis", email = "larjohn@gmail.com", role = "aut"),
@@ -72,5 +72,5 @@ Collate:
7272
'tableschema.r.R'
7373
'validate.R'
7474
'writable.R'
75-
RoxygenNote: 7.2.1
75+
RoxygenNote: 7.3.1
7676
Roxygen: list(r6 = FALSE)

Makefile

Lines changed: 0 additions & 14 deletions
This file was deleted.

NEWS.Rmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ output:
44
github_document:
55
html_preview: yes
66
---
7+
#### tableschema-r v1.1.3
8+
9+
update roxygen documentation
710

811
#### tableschema-r v1.1.2
912

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
NEWS
22
================
33

4+
#### tableschema-r v1.1.3
5+
6+
update roxygen documentation
7+
48
#### tableschema-r v1.1.2
59

610
update links in documentation

R/field.R

Lines changed: 57 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,78 @@
1-
#' Field class
1+
#' @title Field class
2+
#'
3+
#' @description Class representing a field in the schema.
4+
#'
5+
#' Data values can be cast to native R types. Casting a value checks whether it is of the expected type, in the correct format, and compliant with any constraints imposed by the schema.
6+
#'
7+
#' @usage
8+
#' # Field$new(descriptor, missingValues = list(""))
9+
#'
10+
#' @param descriptor Schema field descriptor.
11+
#' @param missingValues A list with vector strings representing missing values.
212
#'
3-
#' @description Class represents field in the schema.
4-
#'
5-
#' Data values can be cast to native R types. Casting a value will check
6-
#' the value is of the expected type, is in the correct format,
7-
#' and complies with any constraints imposed by a schema.
8-
#'
9-
#' @usage # Field$new(descriptor, missingValues = list(""))
10-
#' @param descriptor Schema field descriptor
11-
#' @param missingValues A list with vector strings representing missing values
12-
#'
13-
#'
1413
#' @section Methods:
1514
#' \describe{
16-
#'
17-
#' \item{\code{Field$new(descriptor, missingValues = list(""))}}{
18-
#'Constructor to instantiate \code{Field} class.}
19-
#' \itemize{
20-
#' \item{\code{descriptor }}{Schema field descriptor.}
21-
#' \item{\code{missingValues }}{A list with vector strings representing missing values.}
22-
#' \item{\code{TableSchemaError }}{Raises any error occured in the process.}
23-
#' \item{\code{Field }}{Returns \code{Field} class instance.}
24-
#' }
25-
#' \item{\code{cast_value(value, constraints=TRUE)}}{
26-
#' Cast given value according to the field type and format.}
27-
#' \itemize{
28-
#' \item{\code{value }}{Value to cast against field}
29-
#' \item{\code{constraints }}{ Gets constraints configuration:
30-
#' it could be set to true to disable constraint checks, or
31-
#' it could be a List of constraints to check}
32-
#' \item{\code{errors$TableSchemaError }}{Raises any error occured in the process}
33-
#' \item{\code{any }}{Returns cast value}
34-
#' }
35-
#'
36-
#' \item{\code{testValue(value, constraints=TRUE)}}{
37-
#' Test if value is compliant to the field.}
38-
#' \itemize{
39-
#' \item{\code{value }}{Value to cast against field}
40-
#' \item{\code{constraints }}{Constraints configuration}
41-
#' \item{\code{Boolean }}{Returns if value is compliant to the field}
42-
#' }
15+
#' \item{\code{Field$new(descriptor, missingValues = list(""))}}{Constructor to instantiate the \code{Field} class. Accepts the following arguments:
16+
#' \describe{
17+
#' \item{\code{descriptor}}{Schema field descriptor.}
18+
#' \item{\code{missingValues}}{A list of strings representing missing values.}
19+
#' \item{\code{TableSchemaError}}{Raised if an error occurs during instantiation.}
20+
#' \item{\code{Field}}{Returns a \code{Field} class instance.}
21+
#' }
22+
#' }
23+
#'
24+
#' \item{\code{cast_value(value, constraints = TRUE)}}{Casts a given value according to the field's type and format.
25+
#' \describe{
26+
#' \item{\code{value}}{Value to cast.}
27+
#' \item{\code{constraints}}{Logical or list of constraints to apply.}
28+
#' \item{\code{errors$TableSchemaError}}{Raised if casting fails due to a constraint violation.}
29+
#' \item{\code{any}}{Returns the cast value.}
30+
#' }
31+
#' }
32+
#'
33+
#' \item{\code{testValue(value, constraints = TRUE)}}{Tests if a value complies with the field definition.
34+
#' \describe{
35+
#' \item{\code{value}}{Value to test.}
36+
#' \item{\code{constraints}}{Constraints configuration.}
37+
#' \item{\code{Boolean}}{Returns \code{TRUE} if the value is compliant.}
38+
#' }
39+
#' }
4340
#' }
44-
#'
41+
#'
4542
#' @section Properties:
4643
#' \describe{
47-
#' \item{\code{name}}{Returns field name}
48-
#' \item{\code{type}}{Returns field type}
49-
#' \item{\code{format}}{Returns field format}
50-
#' \item{\code{required}}{Returns \code{TRUE} if field is required}
51-
#' \item{\code{constraints}}{Returns list with field constraints}
52-
#' \item{\code{descriptor}}{Returns field descriptor}
44+
#' \item{\code{name}}{Returns the field name.}
45+
#' \item{\code{type}}{Returns the field type.}
46+
#' \item{\code{format}}{Returns the field format.}
47+
#' \item{\code{required}}{Returns \code{TRUE} if the field is required.}
48+
#' \item{\code{constraints}}{Returns a list of field constraints.}
49+
#' \item{\code{descriptor}}{Returns the field descriptor.}
5350
#' }
54-
#'
55-
#'
56-
#' @details
57-
#' A field descriptor \code{MUST} be a JSON object that describes a single field.
58-
#' The descriptor provides additional human-readable documentation for a field,
59-
#' as well as additional information that may be used to validate the field or
60-
#' create a user interface for data entry.
61-
#'
62-
#' The field descriptor \code{object} \code{MAY} contain any number of other properties.
63-
#' Some specific properties are defined below. Of these, only the \code{name} property is \code{REQUIRED}.
64-
#'
51+
#'
52+
#' @details
53+
#' A field descriptor \code{MUST} be a JSON object that describes a single field. The descriptor provides both human-readable documentation and machine-readable validation rules. It may also guide user interface generation for data entry.
54+
#'
55+
#' The descriptor \code{object} \code{MAY} include additional custom properties. Of these, only the \code{name} property is \code{REQUIRED}.
56+
#'
6557
#' \describe{
66-
#' \item{\code{name}}{
67-
#' The field descriptor \code{MUST} contain a \code{name} property.
68-
#' This property \code{SHOULD} correspond to the name of field/column in the data file (if it has a name).
69-
#' As such it \code{SHOULD} be unique (though it is possible, but very bad practice, for the data file to
70-
#' have multiple columns with the same name). \code{name} \code{SHOULD NOT} be considered case sensitive in
71-
#' determining uniqueness. However, since it should correspond to the name of the field in the data file
72-
#' it may be important to preserve case.}
73-
#' \item{\code{title}}{
74-
#' A human readable label or title for the field.}
75-
#'
76-
#' \item{\code{description}}{
77-
#' A description for this field e.g. "The recipient of the funds".}
58+
#' \item{\code{name}}{The descriptor \code{MUST} contain a \code{name} property, typically corresponding to the column name in the data file. This name \code{SHOULD} be unique, and while not case-sensitive for uniqueness, preserving case is advisable.}
59+
#' \item{\code{title}}{A human-readable label for the field.}
60+
#' \item{\code{description}}{A text description of the field, e.g., "The recipient of the funds".}
7861
#' }
79-
#'
80-
#'
81-
#'
62+
#'
8263
#' @section Language:
83-
#' The key words \code{MUST}, \code{MUST NOT}, \code{REQUIRED}, \code{SHALL}, \code{SHALL NOT},
84-
#' \code{SHOULD}, \code{SHOULD NOT}, \code{RECOMMENDED}, \code{MAY}, and \code{OPTIONAL}
85-
#' in this package documents are to be interpreted as described in \href{https://www.ietf.org/rfc/rfc2119.txt}{RFC 2119}.
86-
#'
87-
#'
64+
#' The key words \code{MUST}, \code{MUST NOT}, \code{REQUIRED}, \code{SHALL}, \code{SHALL NOT}, \code{SHOULD}, \code{SHOULD NOT}, \code{RECOMMENDED}, \code{MAY}, and \code{OPTIONAL} in this documentation are to be interpreted as described in \href{https://www.ietf.org/rfc/rfc2119.txt}{RFC 2119}.
65+
#'
8866
#' @docType class
8967
#' @importFrom R6 R6Class
9068
#' @export
9169
#' @include types.R
9270
#' @include constraints.R
9371
#' @keywords data
94-
#' @return Object of \code{\link{R6Class}} .
72+
#' @return Object of class \code{\link{R6Class}}.
9573
#' @format \code{\link{R6Class}} object.
96-
#' @param base_path see description
97-
#' @param strict see description
98-
#' @param value see description
99-
#' @param constraints see description
100-
#' @param ... see description
74+
#'
10175
#' @seealso \href{https://specs.frictionlessdata.io//table-schema/#field-descriptors}{Field Descriptors Specifications}
102-
#'
10376
#' @examples
10477
#' DESCRIPTOR = list(name = "height", type = "number")
10578
#'

R/infer.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#' \item readable stream with CSV file contents
99
#' \item function returning readable stream with CSV file contents
1010
#' }
11-
#' @param options any \code{\link{Table.load}} options
11+
#' @param options any \code{Table.load} options
1212
#' @rdname infer
1313
#' @export
1414
#' @return Schema descriptor

R/profile.R

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
1-
#' Profile class
2-
#' @description Class to represent JSON Schema profile from \href{https://specs.frictionlessdata.io/schemas/registry.json}{Profiles Registry}.
3-
#'
4-
#' @usage # Profile.load(profile)
5-
#' @param profile string profile name in registry or URL to JSON Schema
6-
#'
7-
#'
1+
#' @title Profile class
2+
#'
3+
#' @description Class to represent a JSON Schema profile from the \href{https://specs.frictionlessdata.io/schemas/registry.json}{Profiles Registry}.
4+
#'
5+
#' @usage
6+
#' # Profile$load(profile)
7+
#'
8+
#' @param profile String: the name of a profile from the registry or a URL pointing to a JSON Schema.
9+
#'
810
#' @section Methods:
911
#' \describe{
10-
#'
11-
#' \item{\code{Profile$new(descriptor = descriptor)}}{
12-
#' Use \code{\link{Profile.load}} to instantiate \code{Profile} class.}
13-
#'
14-
#' \item{\code{validate(descriptor)}}{
15-
#' Validate a tabular data package descriptor against the \code{Profile}.}
16-
#' \itemize{
17-
#' \item{\code{descriptor }}{Retrieved and dereferenced tabular data package descriptor.}
18-
#' \item{\code{(Object) }}{Returns \code{TRUE} if descriptor is valid or \code{FALSE} with error message.}
19-
#' }
12+
#' \item{\code{Profile$new(descriptor = descriptor)}}{Use \code{Profile$load} to instantiate a \code{Profile} class.}
2013
#'
14+
#' \item{\code{validate(descriptor)}}{Validate a tabular data package descriptor against the \code{Profile}.
15+
#' \describe{
16+
#' \item{\code{descriptor}}{The dereferenced tabular data package descriptor to validate.}
17+
#' \item{Return value}{Returns \code{TRUE} if the descriptor is valid; otherwise returns \code{FALSE} with an error message.}
18+
#' }
19+
#' }
2120
#' }
22-
#'
21+
#'
2322
#' @section Properties:
2423
#' \describe{
25-
#' \item{\code{name}}{Returns profile name if available.}
26-
#' \item{\code{jsonschema}}{Returns profile JSON Schema contents.}
24+
#' \item{\code{name}}{Returns the profile name, if available.}
25+
#' \item{\code{jsonschema}}{Returns the contents of the profile's JSON Schema.}
2726
#' }
28-
#'
27+
#'
2928
#' @seealso \href{https://specs.frictionlessdata.io//profiles/}{Profile Specifications}
30-
#'
29+
#'
3130
#' @docType class
3231
#' @importFrom R6 R6Class
3332
#' @export
3433
#' @include types.R
3534
#' @include constraints.R
3635
#' @include tableschemaerror.R
3736
#' @keywords data
38-
#' @return Object of \code{\link{R6Class}} .
37+
#' @return Object of class \code{\link{R6Class}}.
3938
#' @format \code{\link{R6Class}} object.
40-
#'
4139

4240
Profile <- R6Class(
4341
"Profile",

0 commit comments

Comments
 (0)