mercredi 20 mai 2015

How to add rows to empty data frames in R based only if empty data frame generated?

To build off of this question: How to add rows to empty data frames with header in R?

If I happen to generate a data frame that is empty (I don't necessarily know which will be empty and which will contain data until I try to run the code) can I build in contigency: "if data frame is empty THEN assign zeros to all columns, if data frame has data, keep that data." ?

Thanks!

I can try to share some code if it's helpful, but if we can work with the code in the related example that will help me immensely.

Aucun commentaire:

Enregistrer un commentaire