Used to deal with the underlying input-output streams of the R process

Constructors

  • Parameters

    • options: {
          commandLineOptions: readonly string[];
          cwd: string;
          env: undefined | {};
          eol: string;
          homeLibPath: undefined | string;
          onRevive: ((code: number, signal: null | string) => void);
          pathToRExecutable: string;
          revive: RShellReviveOptions;
      }
      • ReadonlycommandLineOptions: readonly string[]

        Command line options to use when starting the R session.

      • Readonlycwd: string

        The current working directory of the R session.

      • Readonlyenv: undefined | {}

        The environment variables available in the R session.

      • Readonlyeol: string

        The character to use to mark the end of a line. Is probably always \n (even on windows).

      • ReadonlyhomeLibPath: undefined | string

        The path to the library directory, use undefined to let R figure that out for itself

      • ReadonlyonRevive: ((code: number, signal: null | string) => void)

        Called when the R session is restarted, this makes only sense if revive is not set to 'never'

          • (code, signal): void
          • Parameters

            • code: number
            • signal: null | string

            Returns void

      • ReadonlypathToRExecutable: string

        The path to the R executable, can be only the executable if it is to be found on the PATH.

      • Readonlyrevive: RShellReviveOptions

        If set, the R session will be restarted if it exits due to an error

    • log: Logger<ILogObj>

    Returns RShellSession

Methods

  • Collect lines from the selected streams until the given condition is met or the timeout is reached

    This method does allow other listeners to consume the same input

    Parameters

    • from: OutputStreamSelector

      The stream(s) to collect the information from

    • until: CollectorUntil

      If the predicate returns true, this will stop the collection and resolve the promise

    • timeout: CollectorTimeout

      Configuration for how and when to timeout

    • Optionalaction: (() => void)

      Event to be performed after all listeners are installed, this might be the action that triggers the output you want to collect

        • (): void
        • Returns void

    Returns Promise<string[]>

  • close the current R session, makes the object effectively invalid (can no longer be reopened etc.)

    Parameters

    • OptionalfilesToUnlink: readonly string[]

      If set, these files will be unlinked before closing the session (e.g., to clean up tempfiles)

    Returns boolean

    true if the kill succeeds, false otherwise

    RShell#close

  • Parameters

    • callback: ((code: number, signal: null | string) => void)
        • (code, signal): void
        • Parameters

          • code: number
          • signal: null | string

          Returns void

    Returns void