Rename colData column
1
0
Entering edit mode
achoppe ▴ 10
@375a1478
Last seen 6 months ago
Australia

Hello, this is really simple but I can't figure it out: How do I rename a column in my colData? I can change a variable within the colData column:

sce$Group <- factor(gsub("Group_A","Group_B",sce$Group))

Which will replace Group_A with Group_B within the "Group" colData. But how can I change the column title "Group" to something else?

THANK YOU

SingleCellExperiment colData rename • 1.5k views
ADD COMMENT
0
Entering edit mode
Basti ▴ 780
@7d45153c
Last seen 5 days ago
France

It is necessary to remain prudent with this kind of direct modifications on the SCE objects, the best being to conceive well the SCE object at the very beginning rather than to make modifications afterwards. However, you could rename the columns of the colData feature : names(colData(sce))[which(names(colData(sce))=="Group")]="new_variable"

ADD COMMENT

Login before adding your answer.

Traffic: 615 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