R Building Node - Model Options Tab

Model Name. When Auto is selected, the model name is automatically set to the string "R Syntax". Select Custom to specify a custom model name in the adjoining text field. If you have executed the node once, and you do not specify a different model name before you execute the node again, the model from the previous execution will be overwritten.

Read Data Options. With these options, you can specify how missing values, flag fields, and variables with date or datetime formats are handled.

  • Convert flag fields. Specifies how flag fields are treated. There are two options: Strings to factor, Integers and Reals to double, and Logical values (True, False). If you select Logical values (True, False) the original values of the flag fields are lost. For example, if a field has values Male and Female, these are changed to True and False.
  • Convert missing values to the R 'not available' value (NA). When selected, any missing values are converted to the R NA value. The value NA is used by R to identify missing values. Some R functions that you use might have an argument that can be used to control how the function behaves when the data contain NA. For example, the function might allow you to choose to automatically exclude records that contain NA. If this option is not selected, any missing values are passed to R unchanged, and might cause errors when your R script is executed.
  • Convert date/time fields to R classes with special control for time zones. When selected, variables with date or datetime formats are converted to R date/time objects (POSIXt).
    Note: By default, date or datetime variables are not converted and are passed to R as a numeric value. The timestamp variable is a numeric value that represents the number of seconds since midnight January 1st 1970. The R date and time objects (POSIXt) use the R GMT(UTC) time zone. If you convert an R object to an R date or time object with a non-GMT(UTC) time zone, and return the date or time variable to SPSS® Modeler, the date or time data may show a time zone difference.
    You can select one of two conversion options:
    • R POSIXct. Variables with date or datetime formats are converted to R POSIXct objects.
    • R POSIXlt (list). Variables with date or datetime formats are converted to R POSIXlt objects.
    Note: The POSIX formats are advanced options. Use these options only if your R script specifies that datetime fields are treated in ways that require these formats. The POSIX formats do not apply to variables with time formats.
  • Output Options. With these options, you can specify how output from R is displayed.
    • Display R graphs as HTML. When selected, R graphs are displayed in HTML format on the Graph Output tab of the R model nugget. The Graph Output tab displays only those plots that are generated from executing the R script in the R model building syntax field of the Syntax tab. See the topic R Model Nugget - Graph Output Tab for more information.
    • Display R text output. When selected, any text output that is produced by executing the R script in the R model building syntax field is displayed on the Text Output tab of the R model nugget. See the topic R Model Nugget - Text Output Tab for more information. If you want the text output to be saved to a file, include a call to the R sink function in your script. Any output that is produced after the call to the sink function is not displayed on the Text Output tab. Any R error messages or warnings that result from executing your R model building script are always displayed on the Console Output tab of the R Building node.