NewDataframe
------------

The NewDataframe command copies or creates a new dataframe.  It can be used in two ways.    
    
An existing dataframe can be copied to a new dataframe by using the consumesDataframe and producesDataframe properties of NewDataframe.  The new dataframe will be a "deep" copy in the sense used in R and Python.      
   
NewDataframe can also be used to create an empty dataframe of a specific size.  In Stata, the "set obs #" command will create a dataframe with a user-defined number of rows.  All values are assumed to be missing.  This may be used in simulations to preset a number of simulated observations, which are then filled with randomly generated data.





Properties
~~~~~~~~~~

.. csv-table::
   :header: "Name","Type","","Description"
   :widths: 15,10,5,100

   "NumberOfRows","`int <https://cogsdata.org/docs/modeler-guide/primitive-types/#int>`_","0..1","Number of rows in new dataframe"
   "NumberOfColumns","`int <https://cogsdata.org/docs/modeler-guide/primitive-types/#int>`_","0..1","Number of columns in new dataframe"

Properties Inherited from TransformBase
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. csv-table::
   :header: "Name","Type","","Description"
   :widths: 15,10,5,100

   "ProducesDataframe",":doc:`/composite-types/DataframeDescription/index`","0..n","Signify the dataframe which this transform produces."
   "ConsumesDataframe",":doc:`/composite-types/DataframeDescription/index`","0..n","Signify the dataframe which this transform acts upon."

Properties Inherited from CommandBase
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. csv-table::
   :header: "Name","Type","","Description"
   :widths: 15,10,5,100

   "Command","`string <https://cogsdata.org/docs/modeler-guide/primitive-types/#string>`_","1..1","The type of command"
   "SourceInformation",":doc:`/composite-types/SourceInformation/index`","0..n","Information about the source of the command."
   "MessageText","`string <https://cogsdata.org/docs/modeler-guide/primitive-types/#string>`_","0..n","Adds a message that can be displayed with the command."


Item Type Hierarchy
~~~~~~~~~~~~~~~~~~~

* :doc:`/composite-types/CommandBase/index`
    * :doc:`/composite-types/TransformBase/index`
        * **NewDataframe**


Relationships
~~~~~~~~~~~~~
The following identified item types reference this type.

.. container:: image

   |stub|

.. |stub| image:: ../../images/NewDataframe.svg