Column names that use carriage returns cannot be used in a "Tools > Regression Modeling..." model formula.

Column names that use carriage returns cannot be used in a "Tools > Regression Modeling..." model formula.

book

Article ID: KB0078312

calendar_today

Updated On:

Products Versions
Spotfire Analyst All supported versions
Spotfire Web Player All supported versions
Spotfire Enterprise Runtime for R All supported versions

Description

Column names that use carriage returns (newline characters) cannot be used in a "Tools > Regression Modeling..." or "Tools > Classification Modeling..." model formula.


For example, if the following is a Spotfire column name:

PV20
(M$)

then point-and-click selections in Spotfire that use it to define a statistical modeling formula will lead to a formatted display in the dialog's "Formula expression (column names quoted with backticks)" field that looks like this:

`PV20(M$)` ~ `Oil/ft` + `Gas/ft`

But if that formula is copied and pasted into a Notepad text file, its true format will be displayed:

`PV20
(M$)` ~ `Oil/ft` + `Gas/ft`

If the dialog's OK button is pressed using this formula, no model will be generated in Spotfire, and the following Alerts will be thrown:

-------------
Could not execute function call.
TIBCO Enterprise Runtime for R returned an error: 'Error in map(rownames(factors), backtickedVarNames, varNames) : NAs are not allowed in subscripted assignments
eval(expr, envir, enclos)
eval(expr, envir, enclos)
linearRegFit(formula, data, weights, modelName, nameRowIndex)
eval(expr, envir, enclos)
eval(expr, envir, enclos)
lm(formula = `PV20
model.matrix(mterms, mframe, contrasts.arg = contrasts)
model.matrix.default(mterms, mframe, contrasts.arg = contrasts)
map(rownames(factors), backtickedVarNames, varNames)'.
at Spotfire.Dxp.Data.DataFunctions.Executors.LocalFunctionClient.OnExecuting()
at Spotfire.Dxp.Data.DataFunctions.Executors.AbstractFunctionClient.<RunFunction>d__31.MoveNext()
at Spotfire.Dxp.Data.DataFunctions.Executors.SPlusFunctionExecutor.<ExecuteFunction>d__12.MoveNext()
at Spotfire.Dxp.Data.DataFunctions.DataFunctionExecutorService.<ExecuteFunction>d__3.MoveNext()

TIBCO Enterprise Runtime for R returned warnings
In map(rownames(factors), backtickedVarNames, varNames) : number of items to replace is not a multiple of replacement length

-------------

Note that the error message's stack trace shows only the part of the column name that precedes the carriage return:

lm(formula = `PV20

The carriage return in the column name breaks the formula, and prevents running the model.

 

Issue/Introduction

Column names that use carriage returns (newlines) cannot be used in a "Tools > Regression Modeling..." model formula.

Environment

All supported environments

Resolution

If a Spotfire column name contains a carriage return (newline character), it cannot be used in a regression model formula.

For example, the following column name will not work:

PV20
(M$)


But the following column name will work:

PV20(M$)

Column names that use carriage returns will not work properly when they are sent (in the input data) to the TIBCO Enterprise Runtime for R (TERR) utility functions that actually calculate the "Tools > Regression Modeling..." model in the background.  These TERR functions require one-line column names.


Note:  This is also true for other "Tools > Regression Modeling..." or "Tools > Classification Modeling..." menu selections that define statistical modeling formulas and send them to TIBCO Enterprise Runtime for R (TERR) for processing.

Additional Information