Skip to content
Prev 299837 / 398503 Next

fill 0-row data.frame with 1 line of NAs

On Wed, Jul 11, 2012 at 9:56 PM, William Dunlap <wdunlap at tibco.com> wrote:
I'm running an apply(df, 1, f) function, where f() matches a df$string
in another matrix and fetches data associated with this string. When
no match is made I do not need a zero-row data frame, but to preserve
the structure of the original df I need a data frame with 1 row of
NAs. There may be a nicer approach, but I'm not aware of any.

Regards
Liviu