Reputation: 704
How do I add the additional text p=
before the values in the data frame?
Do you use gsub?
> pvaluesmir21
Seqbuster_Filter_MM_miR21_5p$FDR
1 8.326135e-02
2 6.336574e-05
3 3.233019e-17
4 4.800951e-22
5 3.054728e-10
6 6.697357e-11
Upvotes: 0
Views: 50
Reputation: 887038
It is more natural to use paste
or sprintf
pvaluemir21[,1] <- paste('p =', pvaluemir21[,1])
Or
pvaluemir21[,1] <- sprintf('p = %f', pvaluemir21[,1])
But sub
can be used
pvaluemir21[,1] <- sub('(.*)', 'p=\\1', pvaluesmir21[,1])
Upvotes: 3