Yahya Alramadan Posted May 25, 2022 Share Posted May 25, 2022 I'm using the data function (Model II Regression Straight Line Fit) referenced in the link below to fit a straight line on my data. In my case, I need to fit the line only on the marked data . I have the data function set to refresh automatically so that the line fit will change upon marking other data sets. That works perfectly. However, when there is no marked rows, I keep getting the annoying error message shown at the end of the post. How can I edit the script to get rid of the error message when no data is marked either of the following will work for me hide the error message terminate the R Script set both the slope and intercept to 0 (zero) any other way is fine Appreciate your help as I have limited experience with R Scripts Here is the script I'm using: How to do a Model II Regression Straight Line Fit, using a data function:https://support.tibco.com/s/article/Tibco-KnowledgeArticle-Article-48165 Error message: TIBCO Enterprise Runtime for R returned an error (5) The data function 'Model II Regression Straight Line Fit' could not be executed. Error in lmodel2(Y ~ X, data = inputdf) : missing value where TRUE/FALSE needed eval(script, envir = .GlobalEnv) eval(script, envir = .GlobalEnv) withCallingHandlers({ suppressWarnings(suppressMessages(RMA_model Link to comment Share on other sites More sharing options...
Fabian Duerr Posted May 26, 2022 Share Posted May 26, 2022 You can expand the script and check if the input data frame (inputdf) has more than 1 row. Only if this is true, execute the script. Otherwise return 0 or NA for slope and intercept: if (nrow(inputdf) 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