Search code examples
rpackagevignettetsibble

After add new code, things cannot knit out


I met a wired situation. After add new code The code cannot knit out.

function_name <- function (...)
{
  output <- if (output_format == "list") {
    evolved.ts
  } else if (output_format == "tsibble") {
    as.tsibble(evolved.ts)
  }
  return(output)
}

Solution

  • You could read the arguments with args <- list(...):

    function_name <- function (...)
    {
      args <- list(...)
      # Code
      output <- if (args$output_format == "list") {
        evolved.ts
      } else if (output_format == "tsibble") {
        as.tsibble(evolved.ts)
      }
      return(output)
    }