Replace special characters with another in row names
1
0
Entering edit mode
@phshimaasherif-22566
Last seen 21 months ago

Hi good evening, I want to replace special characters in row names (.30.) by (-30-)

for example: tag.30.gvs

by tag-30-gvs

for large data frame have more that 300 rownames all needs replacement . Any advice? Thank you

rownames replace characters • 144 views
ADD COMMENT
0
Entering edit mode

Good evening, can you provide some background context as to why you are doing this, and also to which Bioconductor package this relates? Thanks.

ADD REPLY
2
Entering edit mode
@gordon-smyth
Last seen 5 hours ago
WEHI, Melbourne, Australia
  1. You can't because data.frame row names are required to be valid object names in R and "-" is not allowed. See make.names. If you want to use arbitrary characters such as spaces or dashes then create a column to store the values instead of using row.names.

  2. This is a plain R question and nothing to do with Bioconductor.

ADD COMMENT

Login before adding your answer.

Traffic: 489 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6