# How to implement a fractional polynomial transformation in R for logistic regression

I'm working on a data set modeling road kills (0 = random point, 1 = road kill) as a function of a number of habitat variables. Following Hosmer and Lemeshow, I've examined each continuous predictor variable for linearity, and a couple appear nonlinear. I'd like to try a fractional polynomial transformation for each, also following Hosmer and Lemeshow, and have looked at the R package mfp, but I'm having trouble coming up with (and understanding) the R code that will correctly transform the variable. Can anyone suggest R code that would help me accomplish the concepts on p. 101 - 102 of Hosmer and Lemeshow's Applied Logistic Regression (2000).

Here is some R code with an example taken from an example data set included in package MASS:

library(MASS)
library(mfp)
data(birthwt)