Hi,
I am able to take the log value for the third column of a file using the script below. But I want to take the log2 (not the log). How would I write that?
thanks
awk 'BEGIN {OFS="\t"} {print $1, $2, log ($3)}'
Hi,
I am able to take the log value for the third column of a file using the script below. But I want to take the log2 (not the log). How would I write that?
thanks
awk 'BEGIN {OFS="\t"} {print $1, $2, log ($3)}'
Post the input and the expected output.
I don't know awk, but if you can take a log, you can take a base 2 log.
Given that you know X and you want to know log2 X:
log2 X = Y
2 ** (log2 X) = X = 2 ** Y
log X = Y log 2
Y = log X / log 2
Or roughly
log2 X = 3.322 log X