R reference
Load the SDK once at the beginning of an R processing script:
Read inputs
ft_input_table(name, as_data_frame = TRUE)
Reads an Arrow table input. It returns a data.frame by default. Set
as_data_frame = FALSE to keep the result as an Arrow table.
Read a declared input only once. Choose the representation you intend to use
rather than calling ft_input_table twice.
ft_input_json(name, simplify_vector = FALSE)
Reads and decodes JSON.
Set simplify_vector = TRUE when jsonlite's automatic vector and dataframe
simplification is appropriate for the expected document.
ft_input_file(name)
Returns the read-only local path for a declared file input.
Additional file readers
text <- ft_input_text("notes")
payload <- ft_input_bytes("payload")
table <- ft_input_csv("csv_file")
table <- ft_input_parquet("parquet_file")
Publish outputs
ft_output_table(name, value)
Publishes a dataframe or Arrow-compatible object as an Arrow table.
ft_output_json(name, value, pretty = FALSE)
Publishes a value as JSON.
ft_output_file(name, source_path, content_type)
Publishes an existing file.
Additional file writers
These helpers publish file ports:
ft_output_parquet("dataset", table, compression = "snappy")
ft_output_csv("export", table)
ft_output_text("readme", text, extension = "txt")
ft_output_bytes("image", png_raw, extension = "png", content_type = "image/png")
Execution logs
ft_log("Starting normalization")
ft_log(sprintf("Published %d rows", nrow(result)), "info")
ft_log("No matching rows were found", "warn")
Supported levels are debug, info, warn, and error.
Diagnostics
ft_sdk_info() returns the SDK version and non-secret runtime settings for
troubleshooting.