[rkward-cvs] rkward/rkward/plugins/writetable code.php,NONE,1.1 description.xml,NONE,1.1

Pierre ecoch at users.sourceforge.net
Sat Apr 2 08:56:51 UTC 2005


Update of /cvsroot/rkward/rkward/rkward/plugins/writetable
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14744/writetable

Added Files:
	code.php description.xml 
Log Message:
Adding two new plugins by Adrien to open and save tables in csv files.

--- NEW FILE: description.xml ---
<!DOCTYPE rkplugin>
<document>
  <entry type="entry" id="writetalbe" label="Save as table" />
<!-- The layout-section takes care of the layout of the GUI for this plugin. -->  <dialog>
    <tabbook>
      <tab label="Save as ..." >
        <column>
          <varselector id="vars" label="Select a variable or a table" />
          <varslot multi="false" classes="array data.frame matrix character numeric integer" id="data" source="vars" label="Data" required="true" />
          <browser size="small" initial="~/rk.temp.data" id="file" label="Name of the file" />
        </column>
        <frame label="Options" >
          <row>
            <checkbox value_unchecked="FALSE" checked="false" value="TRUE" id="append" label="Append" />
          </row>
        </frame>
      </tab>
      <tab label="Columns and Rows" >
        <radio id="columns" label="Name of columns" >
          <option value="TRUE" label="Use the names of the columns" />
          <option value="FALSE" label="No names" />
          <option value="custoCol" label="Customize" />
        </radio>
        <varslot multi="false" classes="integer numeric character" id="colnames" source="varname" label="Columns names" depend="custoCol" />
        <radio id="rows" label="Name of rows" >
          <option value="TRUE" id="temp1" label="Use the names of the rows" />
          <option value="FALSE" id="temp2" label="No names" />
          <option value="custoRow" label="Customize rows" />
        </radio>
        <varslot multi="false" classes="integer numeric character" source="varname" id="rownames" label="Names of rows" depend="custoRow" />
        <varselector id="varname" />
      </tab>
      <tab label="Options" >
        <radio id="dec" label="Character for decimal values" >
          <option value="'.'" label="'.'" />
          <option value="','" label="','" />
        </radio>
        <radio id="sep" label="Character to separe value" >
          <option value="'\t'" label="Tab" />
          <option value="';'" label="';'" />
          <option value="','" label="','" />
          <option value="' '" label="Coma" />
        </radio>
        <radio id="qmethod" label="QMethod" >
          <option value="'escape'" label="Escape" />
          <option value="'double'" label="Double" />
        </radio>
        <input size="small" initial="NA" id="na" label="Character for missing values" />
        <input size="small" initial="\n" id="eol" label="Character for end of line" />
        <checkbox value_unchecked="FALSE" checked="true" value="TRUE" id="quote" label="Quote" />
      </tab>
    </tabbook>
  </dialog>
</document>

--- NEW FILE: code.php ---
<?
	function preprocess () {
	}
	
	function calculate () {
?>

write.table ( x =  <? getRK("data") ; ?> , file =  "<? getRK("file") ; ?>" , append =  <? getRK("append") ; ?>  ,quote = <? getRK("quote") ?> ,  sep = <? getRK("sep") ?> , eol = "<? getRK("eol")  ?>" , na = "<? getRK("na")  ?>" ,  dec = <? getRK("dec") ?> , row.names =  <? if (getRK_val("rows") == "custoRow") getRK("rownames") ; else  getRK("rows")  ; ?> ,  col.names =  <? if (getRK_val("columns") == "custoCol") getRK("colnames") ; else  getRK("columns")  ; ?> , qmethod=  <? getRK("qmethod") ; ?> ) 

<?
	}
	
	function printout () {
	// produce the output
?>

<?
	}
	
	function cleanup () {
?>


<?
	}
?>





More information about the rkward-tracker mailing list