Replace special characters with another in row names
1
0
Entering edit mode
@phshimaasherif-22566
Last seen 2.7 years 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 • 313 views
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.

2
Entering edit mode
@gordon-smyth
Last seen 9 minutes 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.