R/Stringify.R

Defines functions Stringify

Documented in Stringify

#' Convert a function into a single string for DataRobot
#' @param functionToConvert function. The function to convert to a string.
#' @param dputFile character. Optional. A filepath to sink dput into.
Stringify <- function(functionToConvert, dputFile = tempfile()) {
  dput(functionToConvert, file = dputFile)
  charVector <- readLines(dputFile)
  outString <- paste(charVector, collapse = "\n")
  return(outString)
}

Try the datarobot package in your browser

Any scripts or data that you put into this service are public.

datarobot documentation built on Nov. 3, 2023, 1:07 a.m.