Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How to craft this function in R?

$
0
0

I am currently trying to write a function that estimates energy expenditure of some lizards through E = e21.44 * (e(8.74901^10−20 / (1.3806488*10−23 *T). T in the equation is equal to the temperature in Kelvin. I know that if I were to plug in a temperature of 20ºC the function should give me an output of about 0.829. However, when I run the function (see below) I get 2.628622e-121. I believe it's the way I am stating how temperature is converted from Celsius to Kelvin is incorrect and I am currently stuck on it.

TempKelvin <- 273.15
Energy = function(TempKelvin = 273.15 {
exp(24.11) * exp(-8.74901*10^20 / (1.3806488*10^-23 * (T + TempKelvin)))
}
Energy(T = 28)

Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>