fitToJSON: Export the results from the Fit function to JSON

View source: R/signatureFitMultiStepLib.R

fitToJSONR Documentation

Export the results from the Fit function to JSON

Description

Exports of the results obtained with the Fit function to JSON. Output adapts based on the options used in the Fit function

Usage

fitToJSON(
  fitObj,
  filename = "export.json",
  nindent = 0,
  disableFileWrite = FALSE,
  blockname = NULL
)

Arguments

fitObj

object obtained from the Fit function

filename

file name where to save the JSON string

nindent

number of tabs of indentation to be used, default=0. This is useful in case one wants to embed the output in a larger JSON document

disableFileWrite

if TRUE the JSON lines are simply printed to screen. This option is used when fitToJSON is called from another function like fitMStoJSON, which itself opens a sink() to write to.

blockname

if specified, the first line will show the given name as the block name, which is useful if the output is embedded in a larger JSON file

Examples

res <- Fit(catalogues,getOrganSignatures("Breast"))
fitToJSON(res,"export.json")

Nik-Zainal-Group/signature.tools.lib documentation built on April 13, 2025, 5:50 p.m.