TIBCO Spotfire FAQ

  • Running multiple TIBCO Spotfire S+ sessions

    To start multiple sessions of TIBCO Spotfire S+ running on the same machine, use the flag /MULTIPLEINSTANCES. 

    This can be added to the Target: line of your S+ shortcut icon in Windows.  Every time the modified shortcut is clicked, a new instance of S+ will open.  To set this flag, right-click on your S+ icon and select "Properties".  Scroll to the end of the Target: line, add a space, and then ‘/MULTIPLEINSTANCES'.    The target line would then read:

     

    For S+ 6.2     "C:\Program Files\Insightful\splus62\cmd\SPLUS.exe" /MULTIPLEINSTANCES

    For S+ 7.0     "C:\Program Files\Insightful\splus70\cmd\SPLUS.exe" /MULTIPLEINSTANCES

    For S+ 8.0     "C:\Program Files\Insightful\splus80\cmd\SPLUS.exe" /MULTIPLEINSTANCES

    For S+ 8.1     "C:\Program Files\TIBCO\splus81\cmd\SPLUS.exe" /MULTIPLEINSTANCES

     

    Click "Ok" to apply the settings and close the dialog box.  You will need to do this to all icons you use to start S+.

  • Contrasts: Coding of Factors in TIBCO Spotfire S+

    Why does the output from a model with N-level factor variable return only N-1 coefficients?  

    To demonstrate contrasts or the coding of factors in TIBCO Spotfire S+ consider the following S+ session in which an analysis of variance model is fit with the aov() function:

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

       # Examine the built-in dataset 'guayule'.

       > names(guayule)

       [1] "variety" "treatment" "reps" "plants" "flats"

       > dim(guayule)

       [1] 96 5

     

       # Pick two columns from the dataset for an aov() model.

       > c(data.class(guayule$variety), data.class(guayule$treatment))

       [1] "factor" "factor"

       > c(length(levels(guayule$variety)),

       length(levels(guayule$treatment)))

       [1] 8 4

     

       # Example call to aov().

       > tgaov <- aov(plants ~ variety * treatment, data = guayule)

       > summary(tgaov)

       Df Sum of Sq Mean Sq F Value Pr(F)

       variety 7 763.16 109.02 2.7058 0.01604076

       treatment 3 30774.28 10258.09 254.5959 0.00000000

       variety:treatment 21 2620.14 124.77 3.0966 0.00026666

       Residuals 64 2578.67 40.29

     

       # Note that the degrees of freedom for both factor columns is one less

       # than the number of levels in the column. This means that for a

       # factor with n levels, only n-1 parameters are fit in the model.

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

    This is a result of the way that S+ numerically codes the levels of a factor variable when it includes them in a model computation.  Pages 39-40 in Volume 1 of the "TIBCO Spotfire S+ 8.1 Guide to Statistics" provide a general explanation for this choice in fitting factor variables.  Basically, overparameterization can occur when each level of a factor variable is with its own coefficient.  Instead, linear combinations of the factor levels are fit, and a factor with N levels will have N-1 possible (independent) linear combinations.  This means that only N-1 coefficients will be returned.

    By default, most model functions that require contrasts use the value of

       > options()$contrasts

    to determine their coding scheme.  Currently, there are Helmert contrasts, polynomial contrasts, sum contrasts, and treatment contrasts built into S+.  Sum contrasts produce coefficients whose sum is zero, and treatment contrasts produce dummy coefficients in which the first level of the factor is zeroed out.  For more details on any of these coding schemes, you can type '?contr.helmert' at the S+ prompt to see their common help file.

    As a supplement to the discussion above, you may want to reference "Modern Applied Statistics with S" by W.N. Venables and B.D. Ripley (Fourth Edition).  This text gives a more theoretical discussion on the relationship between the coefficients for contrasts and the coefficients for factor levels.

  • Command Line: How TIBCO Spotfire S+ deals with local and global variables.

    What is the scope of variables during function evaluation?

    - All variables created during function evaluation will be local variables which exist until the function completes and returns its output value.

    - When function A calls function B, a different set of local variables will be created, some of which may have the same names as those in function A.  To keep track of the different variables and their values, TIBCO Spotfire S+ uses "frames".

     

    What is a frame?

    - A frame is best thought of as a set of temporarily stored S+ objects.

    - Unlike objects in directories on the 'search()' list, which are files stored on a hard disk, the contents of a frame are stored in memory.

    - A frame can exist, at the longest, for the duration of the S+ session.

    - Objects stored in frames can be accessed more quickly than objects stored in directories, because they reside in memory, rather than on the hard drive.

     

    How are frames organized?

    - The _session_ frame (frame 0) exists for the duration of the S+ session. It holds objects that can reasonably be expected to start over from default values, such as '.Options'.

    - The _expression_ frame (frame 1) holds objects throughout the evaluation of a typed expression.  Objects in the expression frame disappear after the complete evaluation of the top-level expression.

    - During the evaluation of an expression, higher numbered fames (frame n, where n>=2) are created temporarily.

     

    When S+ searches for objects, it looks for them in each of the following locations, in the order shown:

    - the local frame (frame n)

    - the expression frame (frame 1)

    - the session frame (frame 0)

    - the directories in the 'search()' path

     

    What this means:

    - This means that if you are in frame 7, and want to access something in frame 6 (for example, during the execution of a function), some special provisions are necessary.

    - A key point to remember is that it doesn't matter how deeply nested your calls become: the search path always jumps from the current evaluation frame to frame 1, bypassing all of the evaluation frames in between.

     

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Resources for further information on S+ evaluation frames:

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Chapter 2 of the TIBCO Spotfire S+ 8.1 Programmer's Guide for Windows has the most complete treatment of this subject.

    You can also find information related to the use of S+ frames in the on-line help files that are displayed when you type the following expressions at the S+ command-line prompt:

                ?frame.attributes

                ?assign

                ?new.frame

                ?eval

                ?move.frame

                ?syntax

     

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Q&A which illustrates the discussion above on frames:

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Question:

    ~~~~~~~~~

    "I wrote the following simple function to fit an 'lm()' model and plot the fit. Why do I get an error, and how do I get this to work?"

     

    my.lm.func <- function(my.formula, my.data)

    {

       fit <- lm(my.formula, my.data)

       old.par <- par(mfrow = c(3, 2))

       on.exit(par <- old.par)

       plot(fit)

       fit

    }

     

    Output of a call to this function:

    > my.lm.func(Mileage~Weight,fuel.frame)

    Error: Object "my.formula" not found

    Dumped

     

    Answer:

    ~~~~~~~

    The problem has to do with where S+ looks for objects. As "my.formula" is not one of the arguments to 'plot()' and is not in any directories in the search list, it cannot be found by 'plot()'. Basically, 'plot()' looks at the "call" component of 'fit' when constructing the Cook's distance plot, determines that the name of the formula used to fit the model is "my.formula", doesn't see "my.formula" as an argument to 'plot()' or created within 'plot, and then goes looking down the search list for "my.formula".

     

    Another place S+ looks for objects is in what is called the "expression frame".  One solution to this problem is to place a copy of "my.formula" in the expression frame:

     

    my.lm.func2 <- function(my.formula, my.data)

    {

       assign("my.data", my.data, frame = 1)

       assign("my.formula", my.formula, frame = 1)

       fit <- lm(my.formula, my.data)

       old.par <- par(mfrow = c(3, 2))

       on.exit(par(old.par)

       plot(fit)

       fit

    }

     

    Output of a call to this function:

    > my.lm.func2(Mileage~Weight,fuel.frame)

    Call:

    lm(formula = my.formula, data = my.data)

    Coefficients:

    (Intercept) Weight

    48.34935 -0.008192823

     

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Another discussion on the subject of frames:

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In S, objects defined inside a function are not visible to functions called by the first function. This is explained on pages 118-121 of the "blue book", "The New S Language" by Becker, Chambers and Wilks, and in the TIBCO Spotfire S+ 8.1 Programmer's Guide, in the section titled "Matching Names and Values".

     

    For example:

    a <- 3

    foo <- function(x)

    {

       a <- x

       bar()

    }

      

    bar <- function()

    {

       a

    }

    foo(7)

     

    The result is 3, not 7.

    The bar() function looks for objects in:

    (1) it's own frame   (any objects already defined inside bar)

    (2) frame 1   (the "expression frame", a temporary frame in memory)

    (3) frame 0   (the "session frame", a temporary frame in memory that persists between commands but disappears when you exit S+)

    (4) permanent databases

    'bar' does not look in anywhere between frame 1 and its own frame (in the above example, foo has frame 2 and bar has frame 3.  For another example, if you call f, which calls foo, which calls bar, then f has frame 2, foo frame 3, and bar frame 4).

    In other words, if you define something inside 'foo', it is invisible to 'bar'.

     

    A frame is essentially a list of objects that a function has defined for its own use (but frame 0 and frame 1 are for universal use).  For example, after "a <- x", then foo's frame contains 'a' and 'x'.

    The exception is if you explicitly use:

    get(<an object name>, <the number of the frame of foo>)

    to specify where to look for the object that would otherwise be invisible.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • TIBCO Spotfire S+ was running fine yesterday but today I am experiencing some strange behavior. What is the problem?

    The issue you encountered may be the result of a corrupt .Prefs or .Data directory. Below are a few indications of a corrupt .Prefs directory:

         * The background color of your graph is red.
         * You receive the error message: "There is an unrecognized property in the Argument List at Index..."
         * In a dialog box, "Return Value" appears in the upper left hand corner
         * You are unable to change your Options (Options | General Settings)
         * S+ will not start

    To check to see if your .Prefs directory is corrupt: Close S+ and delete your .Prefs directory. The location depends on which version of S+ you are running.  The default locations are the following for the last three versions of S+:

         S+ 7.0:   C:\Program Files\Insightful\splus70\users\<user_name>\.Prefs
         S+ 8.0:   C:\Documents and Settings\<user_name>\My Documents\S-PLUS Projects\Project1
         S+ 8.1:   C:\Documents and Settings\<user_name>\My Documents\Spotfire S+\Project1

    where <user_name> is your login name for your machine.

    The .Prefs directory stores your user preferences, such as graph colors, default options, etc.  When you restart S+, the defaults will be restored in this directory.  When restarting S+ you will receive a message that .Data and/or .Prefs cannot be found.  Click OK to create the default.  Just the default .Prefs will be created.  If this does not help, your .Data directory may be corrupt.  Please try the following:

     

    Below are a few indications of a corrupt .Data directory:

         * S+ does not start
         * Receive the following error message when accessing an object you created:    
               "Engine connection failure - shutting down S-PLUS recommended"
         * Unexplainable error messages

    To check to see if your .Data directory is corrupt please try the following:

    Start S+ in a *NEW* project directory by defining the S_PROJ environment variable. S_PROJ defines your working .Data, .Prefs and current working directory. For example, create the new "C:\TestProj" directory with nothing in it. Define your S_PROJ variable, at the end of your "Target" line in your S+ icon's shortcut properties. To do this, select your icon, right-click, and select 'Properties' from the contextual menu that opens. Under the shortcut tab, add your S_PROJ definition at the end of the 'Target:' field. For example,

         Target:  "C:\Program Files\TIBCO\splus81\cmd\SPLUS.exe" S_PROJ=C:\TestProj

    specifies to start S+ in the C:\TestProj project directory. Click "OK" and execute S+ from this icon. If the problem persists, then your .Data directory was not corrupt.

    If the .Data directory was corrupt, you will now need to do a data.dump() of your original .Data contents into the new .Data directory:

    1. Start S+ in the newly created S_PROJ directory.

    2. Use attach() from the S+ command line to attach the old .Data directory in position 2 of your S+ search path.  For example:

         > attach("C:/Documents and Settings/<user_name>/My Documents/Spotfire S+/Project1")

    You can also attach the old .Data directory by selecting: File -> Chapters -> Attach/Create Chapter:

         Chapter Folder: C:\Documents and Settings\<user_name>\My Documents\Spotfire S+\Project1
         Label: Project1
         Position: 2

    3. Use data.dump() on the objects in your original .Data directory by typing:

         > data.dump(objects(where=2),"C:/myfile.dmp", where=2)

    to save your old objects into a formatted text file that S+ can interpret. The 'data.dump' file should no longer contain the corrupted files/data.

    4. Use data.restore() on your data.dump file:

         > data.restore("C:/myfile.dmp")

    to restore the old objects in the new working chapter's .Data directory.

    5. Use detach() from the command line to detach the corrupt .Data directory from position 2 of your search path:

         > detach(2)

    You can also detach the corrupt .Data directory by selecting: File -> Chapters -> Detach Chapter.

  • Installing PKGUTILS and CSAN packages in TIBCO Spotfire S+ without internet access

    If your machine does not have internet access (or if a firewall is preventing access) you can download the install files for the pkgutils package from a machine that has internet access by going to the following URL appropriate for your S+ version and OS:

    S+ 8.0.4 for Windows (32-bit):  http://csan.insightful.com/binary/lib/pkgutils_WIN386.zip  

    S+ 8.0.4 for Solaris (32-bit):  http://csan.insightful.com/binary/lib/pkgutils_SUNOS5_SPARC.tar.gz

    S+ 8.0.4 for Linux (32-bit):  http://csan.insightful.com/binary/lib/pkgutils_LINUX.tar.gz

    S+ 8.0.4 for Linux (64-bit):  http://csan.insightful.com/binary/lib/pkgutils_LINUX_64.tar.gz

     

    S+ 8.1.1 for Windows (32-bit):  http://spotfire.tibco.com/csan/binary/lib/pkgutils_forSplus8.1.1_WIN386.zip

    S+ 8.1.1 for Solaris (32-bit): http://spotfire.tibco.com/csan/binary/lib/pkgutils_forSplus8.1.1_SUNOS5_SPARC.tar.gz

    S+ 8.1.1 for Linux (32-bit): http://spotfire.tibco.com/csan/binary/lib/pkgutils_forSplus8.1.1_LINUX.tar.gz

    S+ 8.1.1 for Linux (64-bit): http://spotfire.tibco.com/csan/binary/lib/pkgutils_forSplus8.1.1_LINUX_64.tar.gz

     

    Note: If you do not know your specific version of S+, please run the following command in your S+ session:

    > version

     

    Once this file is downloaded and transferred to your machine, simply unzip the file into SHOME\library, where "SHOME" is the directory path to your S+ installation. 

    (Note: These steps replace running the install.pkgutils() function.)

     

    Since you do not have internet access you will need to do the following to install packages.  You can download the package files directly from the CSAN website (http://spotfire.tibco.com/csan).  You can then use the install.packages() function to install the package zip file you downloaded by setting the "pkgs" argument to the full path to the downloaded file, and by setting "repos=NULL".  For example, the accuracy_1.23-2.zip file was downloaded to the C:\Temp folder on a machine.  To install this package, call the following commands in S+:

    > library(pkgutils)

    > install.packages(pkgs="C:\\Temp\\accuracy_1.23-2.zip", repos=NULL)

    Now, you can load the package by calling:

    > library(accuracy)

    Once you have installed the pkgutils library loaded, you can open the help file for install.packages() for more information on the function:

    > ?install.packages

  • Problem adding S-PLUS plug-in to existing Eclipse installation.

    Unzipping the S-PLUS plugin .zip into a working Eclipse installation with other plugins (with the workspace selection dialog turned off) causes an exception on Eclipse startup. The result is an  Eclipse instance without any valid S-PLUS views.

    Solution: Although the option to add S-PLUS to an existing Eclipse installation is not supported, you can solve this problem by removing the ECLIPSE/configuration/org.eclipse.osgi directory.

  • How to remove unused levels from my factor variable in TIBCO Spotfire S+

     You can use the drop argument with the subset operator ( [] )

       > g5 <- factor(LETTERS[1:5])

       > g5

       [1] A B C D E

       > g4 <- g5[1:4]

       > g4 # note levels are printed since they do not match the values

       [1] A B C D

       Levels:

       [1] "A" "B" "C" "D" "E"

       > g4drop <- g4[drop=TRUE]

       > g4drop # levels are not printed since there is no mismatch

       [1] A B C D

       Here is another example using a sample subset from fuel.frame:

       > smallish.cars <- fuel.frame[fuel.frame$Type %in% c("Compact", "Small",
       "Sporty"),]

       > smallish.cars
       Weight Disp. Mileage Fuel Type
       Eagle Summit 4 2560 97 38 3.030303 Small
       Ford Escort 4 2345 114 38 3.030303 Small
       Ford Festiva 4 1845 81 42 2.702703 Small
       Honda Civic 4 2260 91 37 3.125000 Small
       Mazda Protege 4 2440 113 37 3.125000 Small
       Mercury Tracer 4 2285 97 31 3.846154 Small
       ... <snip>

       # -- Display current levels of factor

       levels(smallish.cars$Type)
       > levels(smallish.cars$Type)
       [1] "Compact" "Large" "Medium" "Small" "Sporty" "Van"

       # Use drop parameter
       # of subset operator to
       # remove unused levels

       > smallish.cars$Type <- smallish.cars$Type[drop=T]

       # -- Display current levels of factor
       > levels(smallish.cars$Type)
       [1] "Compact" "Small" "Sporty"

  • S+ Install: Execute setup.exe NOT setup.msi for installation

     Users should always run setup.exe to install S-PLUS, not setup.msi. This
       is especially important for installations on Windows Vista.

       If the file extensions are hidden so you cannot distinguish between the
       two setup files, follow these instructions:

       1. Select Tools -> Folder Options
       2. Select the View Tab
       3. Uncheck "Hide extensions for Known file types"
       4. Select OK

  • How to define and distribute a new DXP color scheme

       1. In a TIBCO Spotfire plot, right-click and select

          Properties
       2. In the Properties dialog > Colors tab, configure a Color Scheme
       3. Click Save As... (New Scheme or Update Scheme) to save the color scheme locally. The new color scheme will from now on be available on this particular machine (using the Open... button in the current dialog)
       4. To distribute the color Scheme, click Export...
       5. Save a .visconfig file (locally)
       6. Using a TIBCO Spotfire administrator account, go to Tools menu > Administrator Manager
       7. Select the Preferences tab
       8. Select a Group to give access to the color scheme
       9. In the window to the right, select the Configuration Sets tab
      10. Click Import and browse to the saved .visconfig
      11. Enter a suitable Configuration name, then click OK.
      12. The new color scheme will now be available for all users in the choosen group (the next time they start TIBCO Spotfire and connect to the server).

  • How to bin the values on the bar chart x-axis

    If you have a numeric column on the x-axis in your bar chart, it can be binned. To activate the binning, right-click on the x-axis selector > select Auto-bin column. It's now also possible to control the number of bins, using the bin-slider directly above the x-axis selector.

  • Using the Min function when calculating new columns

    The Min function can be used to create a new column containing the smallest value out of several columns for that row.  

       1. For example, load the following dataset into Spotfire : ID col1 col2 col3 a 1 5 56 b 5 54 85 c 12 23 72
       2. Go to Insert > Calculated Column...
       3. In the Expression box enter Min([col1],[col2],[col3])
       4. Select OK - a new column will be created with the values 1, 5 and 12 (the smallest values across the three columns for each row of data).

  • TIBCO Spotfire does not recognize dates in the 'YYYYMMDD' format

    TIBCO Spotfire does not recognize dates in the 'YYYYMMDD' format. Data in this format is interpreted as integers instead of dates.

    There is currently no way to force the data to be imported in a date format.

    A possible workaround is to create a new column (in date format) after the import.

    Example (using the below data as an example):
    ColA;ColB
    20060724;A
    20060831;B

    1. Go to TIBCO Spotfire File menu > Open > File and select the data file
    2. Change the data type during import for ColA to String (from Integer) and import
    3. Then, after the data is opened, go to Insert menu > Calculated Column  and enter the following expression:

    Date(Concatenate(Left([ColA],4),"-",Mid([ColA],5,2),"-",Right([ColA],2)))

    4. Then, click OK - now you have a date column based on the date string that was imported.

  • Does the Web Player Server support Web Garden for IIS 6.0?

    The Web Player Server does not support the Web Garden for IIS 6.0. The Web Player analyses are held “in process” and when you run Web Gardens, the sessions are out of process and you cannot tell which process the analysis will end up in. Different calls to the server may end up in different processes.

  • Can the DateDiff function in TIBCO Spotfire be used to compare months?

    The DateDiff function does not compare the month. It currently only compares in day, hour, minute, second or millisecond.

    To compare months one could instead e.g. use the Month function to extract the months from the dates (and if needed, the Year function to extract the year), and then subtract the results.

  • Can the Web player be configured to access multiple Spotfire Servers?

     Can the Web player be configured to access multiple Spotfire  Servers?
    ----------------------------------------RESOLUTION----------------------------------------
    No, the Web Player is currently only designed to access a single Spotfire Server

More Posts Next page »

Spotfire's interactive information visualization and analytic solutions give users a remarkable experience for quickly and easily querying data and reporting results for superior business intelligence. From portfolio management and customer retention programs to key processes such as CRM, marketing, research, bioinformatics, yield and asset management and design for manufacturing, enterprises around the world rely on Spotfire's business analytics software to improve operational performance.

©Copyright 2000-2009 TIBCO Software Inc | Privacy Policy | Terms of Use | Spotfire Central Sitemap | Content Center I Blog I Contact Us