NameEncode
Obsolete functions to mimic Spotfire's former method of encoding names of columns that are sent to a data function.
Description
These functions do what the functions by the same name in the Spotfire expression
languge do: convert between general UTF-8 strings and encoded versions that use
only 7-but ASCII characters that are syntactically valid S object names.
Usage
NameEncode(str, force = FALSE)
NameDecode(str, force = FALSE)
Arguments
str |
A vector of strings.
|
force |
A logical value. If FALSE, the default, return the input unaltered.
If TRUE return the encoded or decoded strings.
|
Value
If force is FALSE, the input strings are returned, unchanged.
If force is TRUE, a vector of encoded or decoded or decoded strings.
Note
These functions should not be used in data functions written for Spotfire 5.0.
They are only here so that data functions written for Spotfire 4.5 will continue to work.
When Spotfire 4.5 sent a data table to a data function it converted the names of
the columns to names that are syntactically valid S language names. On return to Spotfire,
the names of columns were converted back to their original form. You may
have needed to use these functions if your data function also passed character strings
that refer to the column names. Spotfire 5.0 does not do this encoding automatically,
although the Spotfire expression language functions NameEncode and NameDecode
will do it if you call them.
Examples
e <- NameEncode(c("Revenue ($/month)", "Associate"))
e
e <- NameEncode(c("Revenue ($/month)", "Associate"), force=TRUE)
e
NameDecode(e, force = TRUE)