Data dimensions
Spotfire data |
Spotfire® Enterprise Runtime for R (a/k/a TERR™) / R data |
Value |
Vector of length 1 (list for timeDate) |
Column |
Vector (list for timeDate) |
Data table |
data.frame |
Data types sent from Spotfire and accepted into TERR
Spotfire data type |
Class for TERR and R |
Real |
numeric |
Integer |
integer |
LongInteger |
numeric |
SingleReal |
numeric |
Currency |
numeric |
String |
character encoded as UTF-8 |
DateTime |
POSIXct with time zone UTC |
Date |
POSIXct with time zone UTC |
Time |
POSIXct with time zone UTC giving time on date 1/1/1970 |
Boolean |
logical |
Binary |
raw |
a POSIXct or POSIXlt received from the TERR engine or an open-source R engine is always stored as DateTime in Spotfire.
Open-source R factors are sent from Spotfire Statistics Services as strings.
TERR factors are sent from TERR as strings.
Other data types than the ones described above are not supported.
Data types sent from TERR (as an SBDF file) and imported into Spotfire
Data type sent by TERR |
Data type imported into Spotfire |
logical |
Boolean |
integer |
Integer (32 bit) |
numeric |
Real |
character |
String |
factor |
String |
POSIXct or POSIXlt |
DateTime |
difftime |
TimeSpan |
raw |
Binary |
For more information about exporting TERR/R data in an SBDF data type into Spotfire, see the TERR library reference SpotfireData::exportDataToSBDF.
For more information about importing the contents of an SBDF from Spotfire, see the TERR library reference SpotfireData::importDataFromSBDF.
For more information about getting setting SBDF data types, see the TERR library reference SpotfireData::setSBDFExportTypes.
Note: Exporting an SBDF that contains empty String columns causes an error with Pandas and Numpy. For information about how to export empty String columns, see "Troubleshooting Empty String errors in SBDF exports" in the guide Python Data Functions in Spotfire.
Data types sent from Spotfire and received by Python and Pandas
Data type exported from Spotfire |
Data type received by Python |
Pandas column dtype |
Real |
float |
float64 |
Integer |
int |
Int32 |
LongInteger |
int |
Int64 |
SingleReal |
float |
float32 |
Currency |
decimal.Decimal |
object |
String |
str |
object |
DateTime |
datetime.datetime |
object |
Date |
datetime.date |
object |
Time |
datetime.time |
object |
Boolean |
bool |
object |
Binary |
bytes |
object |
Spotfire columns map in Python to Pandas Series type.
Spotfire tables map in Python to Pandas DataFrame type.
Data types sent from Python and imported into Spotfire
Data type sent by Python |
Data type imported into Spotfire |
int |
LongInteger |
float |
Real |
decimal.Decimal |
Currency |
datetime.date |
Date |
datetime.datetime |
DateTime |
datetime.time |
Time |
datetime.timedelta |
|
bool |
Boolean |
str |
String |
bytes |
Binary |
Support for invalid values
All numeric invalid values in Spotfire are represented as NAs in the TERR, and open-source R engines. There is no special support for invalid values of other types; they become valid default values in the TERR, and open-source R engines.
Calling conventions for functions
The names of the data function input arguments must match the names of the TERR, and open-source R function arguments.
For functions that return only one value (not a list of values), the single data function output parameter will be matched to the value.
For functions returning a list of values, the data function output parameters must match the names of the list elements.
Concerning R:
R is available under separate open source software license terms and is not part of Spotfire. As such, R is not within the scope of your license for Spotfire. R is not supported, maintained, or warranted in any way by Cloud Software Group, Inc. Download and use of R is solely at your own discretion and subject to the free open source license terms applicable to R.
See also: