getAttr             package:gff3Plotter             R Documentation

_E_x_t_r_a_c_t_s _A_t_t_r_i_b_u_t_e _V_a_l_u_e_s _f_r_o_m _a _C_h_a_r_a_c_t_e_r _V_e_c_t_o_r _o_f _A_t_t_r_i_b_u_t_e_s

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

     Returns a vector of 'value'-s for attribute 'field' in a character
     vector stored as 'field = value'. No space is allowed between the
     field name and the equal sign: 'field= 10;' - correct, whereas
     'field = 10;' - wrong. Spaces or absence of those are allowed in
     any other position (see example).

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

     getAttr(x, field, splitter = ";[[:space:]]?")

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

       x: A character vector containing attributes in form 'field =
          value'

   field: A character vector giving the name of the field to extract

splitter: A regular expression for a field separator. Default a
          semicolon optionally followed by a space.

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

     A character vector of the same length as input containing values
     for the given field.

_N_o_t_e:

     The function is adapted from tilingArray::getAttributeField by
     W.Huber (regular expressions are used insted of 'fixed = TRUE').

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

     Oleg Sklyar, email:osklyar@ebi.ac.uk

_R_e_f_e_r_e_n_c_e_s:

     W.Huber, 'tilingArray' R package: <URL:
     http://www.bioconductor.org/packages/bioc/stable/src/contrib/html/
     tilingArray.html>.

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

        attributes = c("height= 25; width= 30; depth=40;", "depth=18;height= 21;width= 16", "width= 0.45;height=-10;depth= 34")
        widths = getAttr(attributes, "width")
        print(widths)

