scaffold_py_function_wrapper: Scaffold R wrappers for Python functions

Description Usage Arguments Note Examples

View source: R/wrapper.R

Description

Scaffold R wrappers for Python functions

Usage

1
2
3
4
5
scaffold_py_function_wrapper(
  python_function,
  r_function = NULL,
  file_name = NULL
)

Arguments

python_function

Fully qualified name of Python function or class constructor (e.g. tf$nn$top_k)

r_function

Name of R function to generate (defaults to name of Python function if not specified)

file_name

The file name to write the generated wrapper function to. If NULL, the generated wrapper will only be printed out in the console.

Note

The generated wrapper will often require additional editing (e.g. to convert Python list literals in the docs to R lists, to massage R numeric values to Python integers via as.integer where required, etc.) so is really intended as an starting point for an R wrapper rather than a wrapper that can be used without modification.

Examples

1
2
3
4

scaffolder documentation built on March 20, 2020, 5:07 p.m.