export              package:rtracklayer              R Documentation

_E_x_p_o_r_t _o_b_j_e_c_t_s _t_o _c_o_n_n_e_c_t_i_o_n_s

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

     Exports (serializes) an object in a given format to a given
     connection.

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

     export(object, con, format, ...)

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

  object: The object to export. 

     con: The connection to which the object is exported. If this is a
          character vector, it is assumed to be a filename and a
          corresponding file connection is created and then closed
          after exporting the object. If missing, the function will
          return the output as a character vector, rather than writing
          to a connection.

  format: The format of the output. If missing and 'con' is a filename,
          the format is derived from the file extension. 

     ...: Parameters to pass to the format-specific export routine. 

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

     This function delegates to another function, depending on the
     specified format. The name of the delegate is of the form
     'export.format' where 'format' is specified by the 'format'
     argument.

_V_a_l_u_e:

     If 'con' is missing, a character vector containing the string
     output. Otherwise, nothing is returned.

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

     Michael Lawrence

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

     'import' for the reverse

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

       track <- import(system.file("tests", "v1.gff", package = "rtracklayer"))
       ## Not run: export(track, "my.gff", version = "3")
       ## equivalently,
       ## Not run: export(track, "my.gff3")
       ## or
       ## Not run: 
       con <- file("my.gff3")
       export(track, con, "gff3")
       close(con)
       
     ## End(Not run)
       ## or as a string
       export(track, format = "gff3")

