On Wed, Jul 11, 2012 at 9:56 PM, William Dunlap <wdun...@tibco.com> wrote:
> Why does one want to replace a zero-row data.frame
> with a one-row data.frame of NA's?  Unless this is for
> an external program that cannot handle zero-row inputs,
> this suggests that there is an unnecessary limitation (i.e.,
> a bug) in the R code that uses this data.frame.
>
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

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to