This is basically the same as
spec.pgram(z, fast = FALSE, detrend = FALSE, taper = 0) $ spec,
and not really recommended to use --- exactly for the reason that
spec.pgram has the defaults differently,
fast = TRUE, detrend = TRUE, taper = 0.1, see that help page.