recursively log-ify expressions

add_d_log(x)

Arguments

x

an expression

Examples

add_d_log(~dnorm(a,b,c))
#> ~dnorm(a, b, c, log = TRUE)
#> <environment: 0x7fe15fb932e8>
add_d_log(~sum(dnorm(a,b,c)))
#> ~sum(dnorm(a, b, c, log = TRUE))
#> <environment: 0x7fe15fb932e8>