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?
Asked
Active
Viewed 79 times
0
-
1Please take the time to create a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-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. – MrFlick Nov 07 '14 at 07:30
1 Answers
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.

Gschneider
- 254
- 2
- 13