writeSDML             package:StatDataML             R Documentation

_W_r_i_t_e _D_a_t_a _i_n _S_t_a_t_D_a_t_a_M_L _F_o_r_m_a_t

_D_e_s_c_r_i_p_t_i_o_n:

     Write data in StatDataML format, either in a file or to standard
     output

_U_s_a_g_e:

     writeSDML(x, file = "", textdata = NULL, dtd = NULL, sep = " &#x000A;&#x000D;",
     na.string = "NA", null.string = "NULL", posinf.string = "+Inf",
     neginf.string = "-Inf", nan.string = "NaN", true = "1", false = "0",
     title = deparse(substitute(x)), source = "R", version = " ",
     date = NULL, comment = " ", properties = NULL) 

_A_r_g_u_m_e_n_t_s:

       x: a data object.

    file: the name of the file to write to. 

textdata: save array elements as 'textdata' blocks instead of 'data'?  
          Numeric arrays are by default ('textdata=NULL') saved in
          'textdata' blocks, character arrays in 'data' blocks.

     dtd: location of the StatDataML DTD.

     sep: field separator for 'textdata' blocks.

na.string: the string which should be interpreted as 'NA' element.

null.string: the string which should be interpreted as NULL string.

posinf.string: the string which should be interpreted as '+Inf'.

neginf.string: the string which should be interpreted as '-Inf'.

nan.string: the string which should be interpreted as 'NaN'.

true, false: the strings which should be interpreted as 'TRUE'/'FALSE'.

   title: the title of the data being saved (string).

  source: the source of the data being saved (string).

 version: the version of the data being saved (string).

 comment: a free form commentary for the data being saved (string).

    date: a free form date element, date() by default.

properties: an arbitrary list or array.

_D_e_t_a_i_l_s:

     'info' attributes of arrays are used for the  'info' attributes of
     the 'e' / 'ce' / 'na' tags in StatDataML. For further details on
     the 'StatDataML' format see the proposal.

_A_u_t_h_o_r(_s):

     David.Meyer@R-Project.org

_S_e_e _A_l_s_o:

     'readSDML'

_E_x_a_m_p_l_e_s:

     A <- matrix(1:16, ncol=4)
     rownames(A) <- paste("row", 1:4, sep="")
     colnames(A) <- paste("col", 1:4, sep="")
     writeSDML(A, "testmat.sdml")

     I <- letters[1:16]
     attr(A, "info") <- I
     writeSDML(A, "testmat2.sdml", textdata = FALSE)

