#log( )
function computes natural logarithms (Ln) for a number or vector. log10 computes common logarithms (Lg).log2 computes binary logarithms (Log2). log(x,b) computes logarithms with base b.
@R_Experts
function computes natural logarithms (Ln) for a number or vector. log10 computes common logarithms (Lg).log2 computes binary logarithms (Log2). log(x,b) computes logarithms with base b.
>log(5) #ln5
[1] 1.609438
>log10(5) #lg5
[1] 0.69897
>log2(5) #log25
[1] 2.321928
>log(9,base=3) #log39 = 2
[1] 2
>x <- rep(1:12)
>x
[1] 1 2 3 4 5 6 7 8 9 10 11 12
>log(x)
[1] 0.0000000 0.6931472 1.0986123 1.3862944 1.6094379 1.7917595 1.9459101
[8] 2.0794415 2.1972246 2.3025851 2.3978953 2.4849066
>log(x,6)
[1] 0.0000000 0.3868528 0.6131472 0.7737056 0.8982444 1.0000000 1.0860331
[8] 1.1605584 1.2262944 1.2850972 1.3382908 1.3868528
@R_Experts
#Log_Normal
curve(dlnorm(x),col="red",lty=1,ylab="Density",@R_Experts
xlim=c(0,3),ylim=c(0,.7),lwd=4,axes=F,main="Log Normal")
axis(1,0:3, 0:3,col.axis="blue")
axis(2, seq(0,.7,.1), seq(0,.7,.1),col.axis="blue")
https