Poisson Models 309
For example, atan calculates angles in radians; to convert them to degrees, we would need to
multiply by 18 0/
π
, so the covariate sho uld be atan(grad) * 180/pi. To prevent the mathemat-
ical symbols * a nd / from being interpreted a s model formula ope rators, this expression should be
enclosed inside the function I (fo r ‘ide ntity’):
> ppm(bei
~
I(atan(grad) * 180/pi), data=bei.extra)
The function I retur ns its argument unchanged, and the r ules for interpreting a formula ensure that
the expression inside the parentheses is evaluated using the usual mathematical operations. T he
command above fits a loglinear model dep ending on the a ngle o f inclination, expressed in degrees.
It may be neater to write a separate R function which ...