Reputation: 313
I am using Tibco Spotfire. In a text area, I have added a drop-down list via Insert property control
with the following relevant parameters:
Control type: Drop-down list
Set property value through: Unique values in column
(Chose a column in a data table. The values populating the column are strings.)
Include (None) alternative: checked
The purpose of the property control is to provide an input to a data function coded using R. The data function basically performs some sums over an input data table, where the items summed over are filtered via the property control prior to summing.
I wanted a (None)
alternative as an option to avoid filtering if the user so chooses. However, I don't know how to check for whether the (None)
option is selected. E.g., let's say, in the R function, the variable linked to the property control is called var_1
. I want some code that says:
# pseudo R code
# Note: the code below is to demonstrate my question, it's not the exact shape of the code I'm actually using.
if (var_1 == (None)) { # this is the line I don't know how to express, since I don't know how Tibco populates a (None) value
do not filter stuff.
}
For that if
statement, I have tried:
if (var_1 == "") {...}
if (var_1 == "(None)") {...}
if (var_1 == "(none)") {...}
if (is.na(var_1)) {...}
Whichever I choose, the summations, which are supposed to include everything in this case, include nothing.
Normally I could figure this out by just printing var_1
's data type to the console after choosing (None)
in the dropdown. When I try that, no console output pops up anywhere.
What data does SpotFire populate var_1
with if (none)
is chosen, or more to the point, what is the if statement I need here?
Thanks.
Upvotes: 0
Views: 1722
Reputation: 1462
It should have been NA. Potentially it was unset the first time you tried.
A useful way of debugging such situations is:
In order to open RStudio on TERR, you can go, from within Spotfire, to Tools>TERR Tools> Launch RStudio IDE. It will open RStudio pointing to the TERR version you are currently running within Spotfire. You can verify it by running the 'version' statement.
Upvotes: 0