Thanks for this! I modified your function a bit to take a model as an argument, although I couldn’t find an easily-accessible property on model objects for k. Still, it’ll output the McFadden’s pseudo-R^2 given a model for an argument.
PRsq<- function (x) {

a= 1- (x$deviance/x$null.deviance)

cat ("Pesudo R Square Estimates", "\n")

cat ("McFadden's: ", a, "\n")

}

]]>