R log Function. Log() function computes natural logarithms (Ln) for a number or vector. Log10 computes common logarithms (Lg). Log2 computes binary logarithms (Log2).