开发者

How can I replace values of 1 with values of .9999 in a column of data?

开发者 https://www.devze.com 2023-03-24 04:34 出处:网络
I\'m have an issue with my analysis and would like to replace all of the 1\'s in a particular column with .9999, for example:

I'm have an issue with my analysis and would like to replace all of the 1's in a particular column with .9999, for example:

  SNP Pvalue
 rs11 0.6516
 rs12 0.3开发者_如何学Go311
 rs13 1.0000

would become

  SNP Pvalue
rs11 0.6516
rs12 0.3311
rs13 0.9999

Thanks in advance for your replies.


Assuming your data.frame is called mydf:

mydf$Pvalue[mydf$Pvalue==1] <- 0.9999

See help('[<-') or any number of introduction to R manuals such as this one:

http://cran.r-project.org/doc/manuals/R-intro.pdf

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号