Package: interfacer 0.3.2

Robert Challen

interfacer: Define and Enforce Contracts for Dataframes as Function Parameters

A dataframe validation framework for package builders who use dataframes as function parameters. It performs checks on column names, coerces data-types, and checks grouping to make sure user inputs conform to a specification provided by the package author. It provides a mechanism for package authors to automatically document supported dataframe inputs and selectively dispatch to functions depending on the format of a dataframe much like S3 does for classes. It also contains some developer tools to make working with and documenting dataframe specifications easier. It helps package developers to improve their documentation and simplifies parameter validation where dataframes are used as function parameters.

Authors:Robert Challen [aut, cre, cph]

interfacer_0.3.2.tar.gz
interfacer_0.3.2.zip(r-4.5)interfacer_0.3.2.zip(r-4.4)interfacer_0.3.2.zip(r-4.3)
interfacer_0.3.2.tgz(r-4.4-any)interfacer_0.3.2.tgz(r-4.3-any)
interfacer_0.3.2.tar.gz(r-4.5-noble)interfacer_0.3.2.tar.gz(r-4.4-noble)
interfacer_0.3.2.tgz(r-4.4-emscripten)interfacer_0.3.2.tgz(r-4.3-emscripten)
interfacer.pdf |interfacer.html
interfacer/json (API)
NEWS

# Install 'interfacer' in R:
install.packages('interfacer', repos = c('https://bristol-vaccine-centre.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/bristol-vaccine-centre/interfacer/issues

On CRAN:

6.67 score 2 stars 2 packages 12 scripts 188 downloads 47 exports 39 dependencies

Last updated 9 days agofrom:63075fa1fb (on 0.3.2). Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 14 2024
R-4.5-winOKNov 14 2024
R-4.5-linuxOKNov 14 2024
R-4.4-winOKNov 14 2024
R-4.4-macOKNov 14 2024
R-4.3-winOKNov 14 2024
R-4.3-macOKNov 14 2024

Exports:%>%check_charactercheck_consistentcheck_datecheck_integercheck_logicalcheck_numericcheck_singleiclipiconvertidispatchidocumentif_col_presentifaceigroup_processimapperiprotoireturnis_col_presentis.ifaceitestivalidaterecycleresolve_missingswitch_pipelinetype.anythingtype.charactertype.completetype.datetype.defaulttype.doubletype.enumtype.factortype.finitetype.group_uniquetype.in_rangetype.integertype.logicaltype.not_missingtype.numerictype.of_typetype.positive_doubletype.positive_integertype.proportiontype.unique_iduse_dataframeuse_iface

Dependencies:brewcallrclicommonmarkcpp11descdigestdplyrevaluatefansiforcatsfsgenericsgluehighrknitrlifecyclemagrittrpillarpkgbuildpkgconfigpkgloadprocessxpspurrrR6rlangroxygen2rprojrootstringistringrtibbletidyselectutf8vctrswithrxfunxml2yaml

Dataframe validation

Rendered frominterfacer.Rmdusingknitr::rmarkdownon Nov 14 2024.

Last update: 2024-07-26
Started: 2023-07-18

Multiple dispatch based on dataframes

Rendered fromdispatch.Rmdusingknitr::rmarkdownon Nov 14 2024.

Last update: 2024-11-07
Started: 2024-07-24

Nested dataframes and purrr style list columns

Rendered fromnesting.Rmdusingknitr::rmarkdownon Nov 14 2024.

Last update: 2024-07-24
Started: 2024-07-24

Parameter consistency checking with interfacer

Rendered fromconsistency.Rmdusingknitr::rmarkdownon Nov 14 2024.

Last update: 2024-11-07
Started: 2024-11-07

Tools to work with interfacer

Rendered fromdevtools.Rmdusingknitr::rmarkdownon Nov 14 2024.

Last update: 2024-07-26
Started: 2024-07-24

Readme and manuals

Help Manual

Help pageTopics
Cast an 'iface' to a plain list.as.list.iface
Checks a set of variables can be coerced to a character and coerces themcheck_character
Check function parameters conform to a set of rulescheck_consistent
Checks a set of variables can be coerced to a date and coerces themcheck_date
Checks a set of variables can be coerced to integer and coerces themcheck_integer
Checks a set of variables can be coerced to a logical and coerces themcheck_logical
Checks a set of variables can be coerced to numeric and coerces themcheck_numeric
Checks a set of variables are all of length onecheck_single
Format an 'iface' specification for printingformat.iface
Create an 'iface' specification from an example dataframeiclip
Convert a dataframe to a format compatible with an interface specificationiconvert
Dispatch to a named function based on the characteristics of a dataframeidispatch
Document an interface contract for inserting into 'roxygen2'idocument
Execute a function or return a value if a column in present in a dataframeif_col_present
Construct an interface specificationiface
Handle unexpected additional grouping structureigroup_process
Specify mappings that can make dataframes compatible with an 'iface' specificationimapper
Generate a zero length dataframe conforming to an 'iface' specificationiproto
Check a return parameter from a functionireturn
Check for existence of a set of columns in a dataframeis_col_present
Check if an object is an interface specificationis.iface
Test dataframe conformance to an interface specification.itest
Perform interface checks on dataframe inputs using enclosing function formal parameter definitionsivalidate
Format an 'iface' specification for printingknit_print.iface
Format an 'iface' specification for printingprint.iface
Strictly recycle function parametersrecycle
Resolve missing values in function parameters and check consistencyresolve_missing
Parser for @iparam tagsroxy_tag_parse.roxy_tag_iparam
Support for @iparam tagsroxy_tag_rd.roxy_tag_iparam
Branch a 'dplyr' pipeline based on a set of conditionsswitch_pipeline
Coerce to an unspecified typetype.anything
Coerce to a character.type.character
Coerce to a complete set of values.type.complete
Coerce to a Date.type.date
Set a default value for a columntype.default
Coerce to a double.type.double
Define a conformance rule to match a factor with specific levels.type.enum
Coerce to a factor.type.factor
Check for non-finite valuestype.finite
Coerce to a unique value within the current grouping structure.type.group_unique
Define a conformance rule to confirm that a numeric is in a set rangetype.in_range
Coerce to integertype.integer
Coerce to a logicaltype.logical
Check for missing valuestype.not_missing
Coerce to a numeric.type.numeric
Check for a given classtype.of_type
Coerce to a positive double.type.positive_double
Coerce to a positive integer.type.positive_integer
Coerce to a number between 0 and 1type.proportion
A globally unique ids.type.unique_id
Use a dataframe in a package including structure based documentationuse_dataframe
Generate interfacer code for a dataframeuse_iface