0

I’m creating a data frame by referring to output values from a large number of segmented regression models that I’m running, each with different initial breakpoint estimates. In some cases, the models are failing to run (which is fine), and therefore not producing output. However, it seems to be unable to create the dataframe when one of the values referred to in the dataframe is not found (i.e. when that particular model did not produce output). When an object is referred to that does not exist, I would like it to be either skipped, or filled in with ‘NA’ in the dataframe. Does anyone know how to deal with this?

1
  • 1
    Please take the time to create a reproducible example. R can certainly add NA values to a data.frame so you must be doing something incorrectly, but right now we have no idea what code you are trying to run. Commented Nov 7, 2014 at 7:30

1 Answer 1

1

Have you thought about using the try function (https://stat.ethz.ch/R-manual/R-devel/library/base/html/try.html)? I'm not sure that it's the optimal solution, but it should work.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.