Skip to content

Commit 0da64bd

Browse files
committed
disambiguate model output object class names
1 parent da630c7 commit 0da64bd

30 files changed

+397
-405
lines changed

NAMESPACE

+121-131
Original file line numberDiff line numberDiff line change
@@ -32,43 +32,137 @@ importFrom(gmodels, estimable)
3232

3333

3434
##################
35+
# ML SE
36+
export(errorsarlm, lagsarlm, sacsarlm)
3537

36-
export(lextrB, lextrW, lextrS, l_max)
37-
38-
export(griffith_sone, subgraph_eigenw)
39-
40-
export(mom_calc, mom_calc_int2)
41-
42-
export(stsls, print.stsls, summary.stsls, print.summary.stsls,
43-
residuals.stsls, coef.stsls, deviance.stsls, impacts.stsls)
44-
45-
export(GMerrorsar, gstsls, GMargminImage,
46-
residuals.gmsar, deviance.gmsar, coef.gmsar, fitted.gmsar,
47-
print.gmsar, summary.gmsar, print.summary.gmsar, impacts.gmsar)
48-
49-
export(lagmess, LR1.lagmess, coef.lagmess, deviance.lagmess, fitted.lagmess,
50-
impacts.lagmess, logLik.lagmess, print.lagmess, print.summary.lagmess,
51-
residuals.lagmess, summary.lagmess)
52-
53-
export(SpatialFiltering, print.SFResult, fitted.SFResult,
54-
ME, print.ME_res, fitted.ME_res)
55-
56-
57-
export(LR.sarlm, LR1.sarlm, Wald1.sarlm)
38+
export(bptest.Sarlm, LR.Sarlm, LR1.Sarlm, Wald1.Sarlm, Hausman.test)
39+
40+
S3method(print, Sarlm)
41+
S3method(summary, Sarlm)
42+
S3method(residuals, Sarlm)
43+
S3method(deviance, Sarlm)
44+
S3method(coef, Sarlm)
45+
S3method(vcov, Sarlm)
46+
S3method(fitted, Sarlm)
47+
S3method(logLik, Sarlm)
48+
S3method(anova, Sarlm)
49+
S3method(predict, Sarlm)
50+
S3method(impacts, Sarlm)
51+
S3method(Hausman.test, Sarlm)
52+
S3method(MCMCsamp, Sarlm)
53+
54+
S3method(print, summary.Sarlm)
55+
S3method(coef, summary.Sarlm)
56+
57+
S3method(print, Sarlm.pred)
58+
S3method(as.data.frame, Sarlm.pred)
59+
60+
# ML SAR/CAR/SMA
61+
export(spautolm, LR1.Spautolm)
62+
63+
S3method(MCMCsamp, Spautolm)
64+
S3method(residuals, Spautolm)
65+
S3method(deviance, Spautolm)
66+
S3method(coef, Spautolm)
67+
S3method(fitted, Spautolm)
68+
S3method(print, Spautolm)
69+
S3method(summary, Spautolm)
70+
S3method(logLik, Spautolm)
71+
72+
S3method(print, summary.Spautolm)
73+
S3method(coef, summary.Spautolm)
74+
75+
# GMM SE
76+
export(stsls)
77+
78+
S3method(residuals, Stsls)
79+
S3method(deviance, Stsls)
80+
S3method(coef, Stsls)
81+
S3method(print, Stsls)
82+
S3method(summary, Stsls)
83+
S3method(impacts, Stsls)
84+
85+
S3method(print, summary.Stsls)
86+
S3method(coef, summary.Stsls)
87+
88+
export(GMerrorsar, gstsls, GMargminImage)
89+
90+
S3method(residuals, Gmsar)
91+
S3method(deviance, Gmsar)
92+
S3method(coef, Gmsar)
93+
S3method(fitted, Gmsar)
94+
S3method(print, Gmsar)
95+
S3method(summary, Gmsar)
96+
S3method(Hausman.test, Gmsar)
97+
S3method(impacts, Gmsar)
98+
99+
S3method(coef, summary.Gmsar)
100+
S3method(print, summary.Gmsar)
101+
102+
# ML MESS
103+
export(lagmess, LR1.Lagmess)
104+
105+
S3method(print, Lagmess)
106+
S3method(summary, Lagmess)
107+
S3method(print, summary.Lagmess)
108+
S3method(residuals, Lagmess)
109+
S3method(deviance, Lagmess)
110+
S3method(coef, Lagmess)
111+
S3method(coef, summary.Lagmess)
112+
S3method(fitted, Lagmess)
113+
S3method(logLik, Lagmess)
114+
S3method(impacts, Lagmess)
115+
116+
# MCMC SET
117+
export(spBreg_lag, spBreg_err, spBreg_sac)
118+
119+
S3method(impacts, MCMC_sar_G)
120+
S3method(impacts, MCMC_sem_G)
121+
S3method(impacts, MCMC_sac_G)
122+
123+
# SLX
124+
export(lmSLX, create_WX)
125+
126+
S3method(impacts, SlX)
127+
S3method(predict, SlX)
128+
129+
# SF/ME
130+
export(SpatialFiltering, ME)
131+
132+
S3method(fitted, SfResult)
133+
S3method(print, SfResult)
134+
S3method(fitted, Me_res)
135+
S3method(print, Me_res)
136+
137+
# Impacts
138+
export(trW, impacts, intImpacts)
139+
140+
S3method(print, LagImpact)
141+
S3method(plot, LagImpact)
142+
S3method(summary, LagImpact)
143+
S3method(HPDinterval, LagImpact)
144+
S3method(print, summary.LagImpact)
145+
146+
S3method(print, WXimpact)
147+
S3method(summary, WXimpact)
148+
S3method(print, summary.WXimpact)
58149

59-
export(Hausman.test, Hausman.test.gmsar, Hausman.test.sarlm,
60-
logLik.sarlm)
150+
exportMethods(coerce)
61151

62152
export(as_dgRMatrix_listw, as_dsTMatrix_listw, as_dsCMatrix_I,
63153
as_dsCMatrix_IrW, Jacobian_W, listw2U_Matrix)
64154

65-
exportMethods(coerce)
66-
67155
export(powerWeights)
68156

69157
export(as.spam.listw, listw2U_spam)
70158

71-
export(trW, impacts, intImpacts, plot.lagImpact, print.lagImpact, print.summary.lagImpact, summary.lagImpact, HPDinterval.lagImpact)
159+
export(lextrB, lextrW, lextrS, l_max)
160+
161+
export(griffith_sone, subgraph_eigenw)
162+
163+
export(mom_calc, mom_calc_int2)
164+
165+
export(MCMCsamp)
72166

73167
export(eigenw, jacobianSetup, can.be.simmed, similar.listw)
74168

@@ -77,114 +171,10 @@ export(do_ldet, eigen_setup, mcdet_setup, cheb_setup, spam_setup,
77171
moments_setup, SE_classic_setup, SE_whichMin_setup, SE_interp_setup,
78172
LU_prepermutate_setup, eigen_pre_setup)
79173

80-
export(MCMCsamp, MCMCsamp.spautolm, MCMCsamp.sarlm)
81-
82-
export(spautolm, residuals.spautolm, deviance.spautolm, coef.spautolm,
83-
fitted.spautolm, print.spautolm, summary.spautolm, LR1.spautolm,
84-
logLik.spautolm, print.summary.spautolm)
85-
86-
export(spBreg_lag, spBreg_err, spBreg_sac, impacts.MCMC_sac_g, impacts.MCMC_sar_g, impacts.MCMC_sem_g)
87-
88-
export(lmSLX, create_WX, predict.SLX, impacts.SLX)
89-
90-
export(errorsarlm, lagsarlm, sacsarlm)
91-
92-
export(print.sarlm, summary.sarlm, residuals.sarlm, deviance.sarlm,
93-
coef.sarlm, fitted.sarlm, logLik.sarlm, anova.sarlm, vcov.sarlm,
94-
predict.sarlm, print.summary.sarlm, print.sarlm.pred,
95-
as.data.frame.sarlm.pred, bptest.sarlm, impacts.sarlm)
96-
97174
export(set.mcOption, get.mcOption, set.coresOption, get.coresOption,
98175
set.ClusterOption, get.ClusterOption)
99176

100177
export(set.VerboseOption, get.VerboseOption, set.ZeroPolicyOption,
101178
get.ZeroPolicyOption)
102179

103-
S3method(residuals, stsls)
104-
S3method(deviance, stsls)
105-
S3method(coef, stsls)
106-
S3method(print, stsls)
107-
S3method(summary, stsls)
108-
S3method(impacts, stsls)
109-
110-
S3method(print, summary.stsls)
111-
S3method(coef, summary.stsls)
112-
113-
S3method(residuals, gmsar)
114-
S3method(deviance, gmsar)
115-
S3method(coef, gmsar)
116-
S3method(fitted, gmsar)
117-
S3method(print, gmsar)
118-
S3method(summary, gmsar)
119-
S3method(Hausman.test, gmsar)
120-
S3method(impacts, gmsar)
121-
122-
S3method(coef, summary.gmsar)
123-
S3method(print, summary.gmsar)
124-
125-
S3method(print, lagmess)
126-
S3method(summary, lagmess)
127-
S3method(print, summary.lagmess)
128-
S3method(residuals, lagmess)
129-
S3method(deviance, lagmess)
130-
S3method(coef, lagmess)
131-
S3method(coef, summary.lagmess)
132-
S3method(fitted, lagmess)
133-
S3method(logLik, lagmess)
134-
S3method(impacts, lagmess)
135-
136-
S3method(fitted, SFResult)
137-
S3method(print, SFResult)
138-
S3method(fitted, ME_res)
139-
S3method(print, ME_res)
140-
141-
S3method(print, lagImpact)
142-
S3method(plot, lagImpact)
143-
S3method(summary, lagImpact)
144-
S3method(HPDinterval, lagImpact)
145-
S3method(print, summary.lagImpact)
146-
147-
S3method(print, sarlm)
148-
S3method(summary, sarlm)
149-
S3method(residuals, sarlm)
150-
S3method(deviance, sarlm)
151-
S3method(coef, sarlm)
152-
S3method(vcov, sarlm)
153-
S3method(fitted, sarlm)
154-
S3method(logLik, sarlm)
155-
S3method(anova, sarlm)
156-
S3method(predict, sarlm)
157-
S3method(impacts, sarlm)
158-
159-
S3method(print, summary.sarlm)
160-
S3method(coef, summary.sarlm)
161-
162-
S3method(print, sarlm.pred)
163-
S3method(as.data.frame, sarlm.pred)
164-
S3method(Hausman.test, sarlm)
165-
S3method(MCMCsamp, sarlm)
166-
167-
S3method(MCMCsamp, spautolm)
168-
S3method(residuals, spautolm)
169-
S3method(deviance, spautolm)
170-
S3method(coef, spautolm)
171-
S3method(fitted, spautolm)
172-
S3method(print, spautolm)
173-
S3method(summary, spautolm)
174-
S3method(logLik, spautolm)
175-
176-
S3method(print, summary.spautolm)
177-
S3method(coef, summary.spautolm)
178-
179-
S3method(impacts, MCMC_sar_g)
180-
S3method(impacts, MCMC_sem_g)
181-
S3method(impacts, MCMC_sac_g)
182-
183-
S3method(print, WXImpact)
184-
S3method(summary, WXImpact)
185-
S3method(print, summary.WXImpact)
186-
187-
S3method(impacts, SLX)
188-
S3method(predict, SLX)
189-
190180

NEWS.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
* #18 standardize use of `coef()` methods for (some) fitted model summary objects
44

5+
* https://github.com/tidymodels/broom/issues/1003#issuecomment-798694400 changing **spatialreg** model output class names: **spdep** `sarlm` -> **spatialreg** `Sarlm`, `spautolm` -> `Spautolm`, `stsls` -> `Stsls`, `gmsar` -> `Gmsar`, `lagmess` -> `Lagmess`, `SLX` -> , `SlX`, `MCMC_s*_g` -> `MCMC_s*_G`, `SFResult` -> `SfResult`, `ME_res` -> `Me_res`, `lagImpact` -> `LagImpact`, `WXImpact` -> `WXimpact`
6+
57
# Version 1.1-5 (2019-12-01)
68

79
* #6, #11 na.action and precomputed eigenvalue bug

R/ME.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ ME <- function(formula, data=list(), family = gaussian, weights, offset, na.acti
176176
res <- list(selection=tres, vectors=sv)
177177
if (!is.null(na.act))
178178
res$na.action <- na.act
179-
class(res) <- "ME_res"
179+
class(res) <- "Me_res"
180180
res
181181
}
182182

183-
print.ME_res <- function(x, ...) {
183+
print.Me_res <- function(x, ...) {
184184
print(x$selection)
185185
}
186186

187-
fitted.ME_res <- function(object, ...) {
187+
fitted.Me_res <- function(object, ...) {
188188
if (is.null(object$na.action)) {
189189
res <- object$vectors
190190
} else {

R/ML_models.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ errorsarlm <- function(formula, data = list(), listw, na.action, weights=NULL,
483483
f_calls=get("f_calls", envir=env),
484484
hf_calls=get("hf_calls", envir=env), intern_classic=iC,
485485
pWinternal=pWinternal, weights=weights, emixedImps=emixedImps),
486-
class=c("sarlm"))
486+
class=c("Sarlm"))
487487
rm(env)
488488
GC <- gc()
489489
if (zero.policy) {
@@ -855,7 +855,7 @@ lagsarlm <- function(formula, data = list(), listw,
855855
timings=do.call("rbind", timings)[, c(1, 3)],
856856
f_calls=get("f_calls", envir=env),
857857
hf_calls=get("hf_calls", envir=env), intern_classic=iC),
858-
class=c("sarlm"))
858+
class=c("Sarlm"))
859859
rm(env)
860860
GC <- gc()
861861
if (zero.policy) {
@@ -1291,7 +1291,7 @@ sacsarlm <- function(formula, data = list(), listw, listw2=NULL, na.action,
12911291
fdHess=fdHess, resvar=asyvar1, listw_style=listw$style,
12921292
optimHess=FALSE, insert=FALSE, interval1=interval1,
12931293
interval2=interval2, timings=do.call("rbind", timings)[, c(1, 3)]),
1294-
class=c("sarlm"))
1294+
class=c("Sarlm"))
12951295
rm(env)
12961296
GC <- gc()
12971297
if (is.null(llprof)) ret$llprof <- llprof

0 commit comments

Comments
 (0)