Ryan Robinson Posted November 2, 2022 Share Posted November 2, 2022 Hello, Can someone explain to me how to install stats package that comes with Spotfire. I have spent all day trying to read all the help files but I can not figure this out. This guy tells me that stats packages "Comes with R package right out of the box"?? Please help me! :( Link to comment Share on other sites More sharing options...
Gaia Paolini Posted November 3, 2022 Share Posted November 3, 2022 It should indeed come out of the box, in the sense that you do not need to install it. If you add this TERR data function, run it with no inputs and assign x to an output table, it should work with no error and produce a table with column col containing 100 random numbers.x=runif(100, min = 0, max = 1)x=data.frame(col=x) Link to comment Share on other sites More sharing options...
Ryan Robinson Posted November 3, 2022 Author Share Posted November 3, 2022 Thank you Gaia! I want to install the supsmu that the guy shows in the youtube video. He is registering it somehow in Spotfire. How do I get the code in the registration function window that's shown on this video. Click on the link to see what I am talking about. The way it is described is this function is inside the stats package. Thank you so much for trying to help me out! Link to comment Share on other sites More sharing options...
Gaia Paolini Posted November 3, 2022 Share Posted November 3, 2022 Yes supsmu is a function within the stats package. Since the stats package is already installed, supsmu is already available too.To continue on the previous example, this would give you a data table df with x, y and a smoothed_yx=seq(1,100)y=runif(100, min = 0, max = 1)df=data.frame(x,y) df$smooth_y=supsmu(df$x,df$y)[[2]]Here is the help for using supsmu:https://docs.tibco.com/pub/enterprise-runtime-for-R/6.0.0/doc/html/Language_Reference/stats/supsmu.htmlIf you mean that you are looking to find out how to register a data function in Spotfire, here is some guidance:https://docs.tibco.com/pub/sfire-analyst/10.3.0/doc/html/en-US/TIB_sfire-analyst_UsersGuide/df/df_how_to_register_a_data_function.htm Link to comment Share on other sites More sharing options...
Ryan Robinson Posted November 3, 2022 Author Share Posted November 3, 2022 Thank you again Gaia i tried to follow the link you gave me on registering the function. When I put the name "supsmu" into the packages window nothing comes out. Do you think I don't have some settings turned on? I tried to click open button but library goes to nothing that has stats folder. Thank you again for all your help Link to comment Share on other sites More sharing options...
Gaia Paolini Posted November 3, 2022 Share Posted November 3, 2022 you don't need to put anything in the packages window in this case, as stats is available automatically. ( I normally ignore the packages window and add a library(<package>) statement instead as first line of the script.)However in this case, you don't need to add anything to the script or packages. Link to comment Share on other sites More sharing options...
Ryan Robinson Posted November 3, 2022 Author Share Posted November 3, 2022 Hi Gaia did you mean like this: Thanks, Link to comment Share on other sites More sharing options...
Heleen Snelting Posted November 4, 2022 Share Posted November 4, 2022 Hi Ryan,Looking at this thread, we think you will benefit from reading about the overall process first to help you understand how you use this – and hope this overview helps:In Spotfire, you incorporate R/TERR code using "data functions"You can create a data function in Spotfire per the link Gaia sent (This page also has a number of helpful links with good overviews of the topics)When registering your data function:The "Script" is the R/TERR code that you write. Here is where you write your custom R/TERR code, and can call the supsmu package for example.The Input Parameters/Output Parameters/etc all define how that script will be incorporated in the Spotfire dxp file (what data am I passing in? Where do I want my data to be output in the Spotfire dxp? ie ouput the data to a new data table called "Results")I will also check to see if we can point you to an example with a data function that uses the supsmu package so you can see it and explore as this should help you further understand the concept.Let us know how you get along!Heleen Link to comment Share on other sites More sharing options...
David Katz Posted November 5, 2022 Share Posted November 5, 2022 Here is an example that may help you. Good luck! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now