[英]How to calculate negative log base ten in R
I have a dataframe called mydf
. 我有一个名为
mydf
的数据mydf
。 I want to calculate -log base 10
for all the values in mydf$colx
. 我想为
mydf$colx
所有值计算-log base 10
。
You can use either the log10(x)
function or the general form log(x, base)
: 您可以使用
log10(x)
函数或一般形式的log(x, base)
:
-log10(100)
# [1] -2
log10(100) * -1
# [1] -2
-log(100, base = 10)
# [1] -2
log(100, base = 10) * -1
# [1] -2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.