getAttr {gff3Plotter} | R Documentation |
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).
getAttr(x, field, splitter = ";[[:space:]]?")
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. |
A character vector of the same length as input containing values for the given field.
The function is adapted from tilingArray::getAttributeField by W.Huber (regular expressions are used insted of fixed = TRUE
).
Oleg Sklyar, email:osklyar@ebi.ac.uk
W.Huber, tilingArray R package: http://www.bioconductor.org/packages/bioc/stable/src/contrib/html/tilingArray.html.
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)