# Exports:
export(
	"dredge", "pdredge", "get.models", "pget.models", 
	"model.avg", "par.avg", 
	"model.sel", "model.sel<-",
	"getAllTerms", "coeffs", "coefTable", 
	"sw", "importance", "Weights", "Weights<-",
	"AICc", "QAIC", "QAICc", "Cp", "ICOMP", "CAICF", "DIC", 
	"r.squaredLR", "null.fit", "r.squaredGLMM",
	"QIC", "QICu", "quasiLik",
	"model.names",
	"simplify.formula", "expand.formula",
	"updateable",
	"uGamm", "nested", "stdize", "stdizeFit",
	"exprApply",
	"get.response",
	"get_call",
	"std.coef", "beta.weights", 
	"partial.sd",
	"arm.glm", "armWeights",
	
	"BGWeights", "cos2Weights", "jackknifeWeights", "stackingWeights", 
	"bootWeights",
	"loo",
    
    fitdistr2,
	
    "coefplot",
    ".get.extras"
)

# Imports:
importFrom("graphics", "axis", "box", "mtext", "par", "plot.new", "plot.window",
	"rect",	"strheight", "strwidth", "title", "abline", "lines", "matplot", 
    "grconvertX", "grconvertY", "points", "segments")

importFrom("grDevices", "n2mfrow", "col2rgb", "hcl.colors", "hcl.pals", "rgb")

importFrom("methods", ".hasSlot", "isGeneric", "slot", "slotNames", "is",
    "selectMethod")

importFrom("stats", ".checkMFClasses", ".getXlevels", ".MFclass", "AIC",
	"as.formula",
	"BIC",
	"delete.response", "deviance", "df.residual",
	"family", "fitted", "formula", "getCall", "glm.fit",  "make.link",
	"median", 
	"model.frame", "model.matrix", "model.response", "na.fail", "nobs", 
	"power", "predict", "printCoefmat", "reformulate", "resid",
	"sigma",
	"sd", "var", "summary.glm", "terms", "terms.formula", 
	"update", "update.default", "update.formula", 
	"weighted.mean", "weights",
    "gaussian", "binomial", "Gamma", "inverse.gaussian", "quasi", 
    "quasibinomial", "quasipoisson",
	"dnorm", "pnorm", "qnorm", "dt", "pt", "qt",
	"rbinom", "rgamma", "rpois", # for .simulateData
     "cor", "cov", "rnorm", "runif", "optim", "confint"
    )

importFrom("stats4", "logLik", "coef", "vcov")

importFrom("utils", "capture.output", "getS3method", "isS3stdGeneric")

importFrom("Matrix", "t", "rowSums", "det", "diag", "solve")

importFrom("nlme", fixef, VarCorr)

# Methods:
S3method(getCall, yagsResult)

S3method(print, averaging)
S3method(print, summary.averaging)
S3method(summary, averaging)
S3method(predict, averaging)
S3method(coef, averaging)
S3method(fitted, averaging)
S3method(logLik, averaging)
S3method(confint, averaging)
S3method(vcov, averaging)
S3method(model.matrix, averaging)
S3method(formula, averaging)

S3method(print, model.selection)
S3method(subset, model.selection)
S3method(nobs, model.selection)
S3method("[", model.selection)
S3method("[[", model.selection)
S3method("[<-", model.selection)
S3method("[[<-", model.selection)
S3method("$<-", model.selection)
S3method("names<-", model.selection)
S3method("row.names<-", model.selection)
S3method(merge, model.selection)
S3method(rbind, model.selection)
S3method(update, model.selection)
S3method(coef, model.selection)
S3method(logLik, model.selection)
S3method(duplicated, model.selection)

S3method(model.sel, model.selection)
S3method(model.sel, averaging)
S3method(model.sel, default)

S3method(model.avg, model.selection)
S3method(model.avg, default)

S3method(plot, model.selection)
S3method(plot, averaging)

S3method(sw, averaging)
S3method(sw, model.selection)
S3method(sw, default)
S3method(print, sw)

S3method(Weights, model.selection)
S3method(Weights, averaging)
S3method(Weights, data.frame)
S3method(Weights, numeric)
S3method(Weights, default)

S3method("Weights<-", averaging)
S3method("Weights<-", default)

S3method(getAllTerms, default)
S3method(coeffs, default)
S3method(coefTable, default)

S3method(coefTable, averaging)

S3method(coef, model.selection)
S3method(coeffs, model.selection)
S3method(coefTable, model.selection)

S3method(print, coefTable)
S3method(plot, coefTable)
S3method(summary, coefTable)
S3method(print, summary.coefTable)

S3method(getAllTerms, formula)
S3method(getAllTerms, terms)

S3method(getAllTerms, lm)
S3method(coefTable, lm)

S3method(getAllTerms, gam)

S3method(nobs, Sarlm)
S3method(coefTable, Sarlm)

S3method(coefTable, Spautolm)
S3method(nobs, Spautolm)

S3method(logLik, glmmML)
S3method(coefTable, glmmML)
S3method(nobs, glmmML)
S3method(getAllTerms, glmmML)
S3method(summary, glmmML)

S3method(getAllTerms, coxph)
S3method(coefTable, coxph)

S3method(coeffs, survreg)
S3method(coefTable, survreg)

S3method(getAllTerms, lme)
S3method(coeffs, lme)
S3method(coefTable, lme)

S3method(model.frame, lme)
S3method(model.matrix, lme)

S3method(coeffs, merMod)

S3method(coefTable, multinom)
S3method(coeffs, multinom)
S3method(nobs, multinom)

S3method(coeffs, gls)
S3method(coefTable, gls)

S3method(formula, unmarkedFit)
S3method(getAllTerms, unmarkedFit)
S3method(coeffs, unmarkedFit)
S3method(coefTable, unmarkedFit)
S3method(nobs, unmarkedFit)
# S3method(getAllTerms, unmarkedFitDS)
# this is done by setting S4 method with an .onLoad hook:
# S3method(logLik, unmarkedFit)

S3method(update, gamm)
S3method(print, gamm)
S3method(logLik, gamm)
S3method(formula, gamm)
S3method(nobs, gamm)
S3method(coeffs, gamm)
S3method(getAllTerms, gamm)
S3method(coefTable, gamm)
S3method(predict, gamm)

S3method(makeArgs, default)
S3method(makeArgs, gls)
S3method(makeArgs, lme)
S3method(makeArgs, unmarkedFit)
S3method(makeArgs, coxph)
S3method(makeArgs, clmm)
S3method(makeArgs, merMod)
S3method(makeArgs, mer) # for 'cpglmm'
S3method(makeArgs, glmmadmb)

S3method(family, default)
S3method(family, gls)
S3method(family, lme)

S3method(nobs, rq)
S3method(coefTable, rq)

S3method(coefTable, coxme)
S3method(makeArgs, coxme)
S3method(formula, coxme)
S3method(getAllTerms, coxme)
S3method(nobs, coxme)
S3method(coeffs, coxme)

S3method(coeffs, lmekin)
S3method(makeArgs, lmekin)
S3method(coefTable, lmekin)
S3method(formula, lmekin)
S3method(nobs, lmekin)
S3method(logLik, lmekin)

S3method(coefTable, zeroinfl)
S3method(coefTable, hurdle)
S3method(getAllTerms, hurdle)
S3method(getAllTerms, zeroinfl)
S3method(nobs, hurdle)
S3method(nobs, zeroinfl)
S3method(makeArgs, zeroinfl)
S3method(family, zeroinfl)

S3method(nobs, glimML)
S3method(formula, glimML)
S3method(coefTable, glimML)
S3method(family, glimML)
S3method(getAllTerms, glimML)
S3method(terms, glimML)
S3method(model.frame, glimML)

S3method(formula, MCMCglmm)
S3method(nobs, MCMCglmm)
S3method(family, MCMCglmm)
S3method(logLik, MCMCglmm)
S3method(coeffs, MCMCglmm)
S3method(coefTable, MCMCglmm)
S3method(makeArgs, MCMCglmm)
S3method(getAllTerms, MCMCglmm)

S3method(extractDIC, merMod)
S3method(extractDIC, MCMCglmm)
S3method(extractDIC, lme)

S3method(coef, geese)
S3method(coefTable, gee)
S3method(coefTable, geeglm)
S3method(coefTable, geese)
S3method(coefTable, geem)
S3method(coefTable, yagsResult)

S3method(getQIC, default)
S3method(getQIC, gee)
S3method(getQIC, geeglm)
S3method(getQIC, yagsResult)
S3method(getQIC, geem)
S3method(getQIC, wgee)

S3method(print, quasiLik)
S3method(quasiLik, gee)
S3method(quasiLik, geem)
S3method(quasiLik, geeglm)
S3method(quasiLik, yagsResult)
S3method(quasiLik, wgee)
S3method(nobs, yagsResult)
S3method(nobs, geem)

S3method(model.matrix, geem)

S3method(coef, wgee)
S3method(coefTable, wgee)
S3method(nobs, wgee)
S3method(formula, wgee)
S3method(makeArgs, wgee)

S3method(coeffs, mark)
S3method(coefTable, mark)
S3method(confint, mark)
S3method(deviance, mark)
S3method(formula, mark)
S3method(getAllTerms, mark)
S3method(logLik, mark)
S3method(makeArgs, mark)
S3method(nobs, mark)

S3method(coefTable, splm)
S3method(coeffs, splm)
S3method(nobs, splm)
S3method(logLik, splm)

S3method(coefTable, logistf)
S3method(nobs, logistf)
S3method(logLik, logistf)

S3method(coefTable, aodml)
#S3method(coeffs, aodml)
S3method(coefTable, aodml)
S3method(makeArgs, aodml)
S3method(nobs, aodql)
S3method(coefTable, aodql)
S3method(model.frame, aodml)
S3method(model.matrix, aodml)

S3method(getAllTerms, betareg)
S3method(makeArgs, betareg)
S3method(coefTable, betareg)
S3method(family, betareg)

S3method(getCall, model.selection)

S3method(nobs, caic)
S3method(formula, caic)
S3method(nobs, pgls)

S3method(nobs, asreml)
S3method(coefTable, asreml)
S3method(family, asreml)
S3method(formula, asreml)
S3method(getAllTerms, asreml)
S3method(logLik, asreml)
S3method(makeArgs, asreml)
S3method(coeffs, asreml)

S3method(nobs, phylolm)
S3method(logLik, phylolm)

S3method(coefTable, cplm)
S3method(coefTable, cpglmm)
S3method(nobs, cplm)
S3method(nobs, cpglmm)
S3method(logLik, cplm)
S3method(coeffs, cpglmm)
S3method(getAllTerms, cpglmm)

S3method(logLik, maxlikeFit)
S3method(nobs, maxlikeFit)
S3method(formula, maxlikeFit)
S3method(coefTable, maxlikeFit)

S3method(coefTable, fitdistr)
S3method(family, fitdistr)
S3method(formula, fitdistr)
S3method(nobs, fitdistr)

S3method(stdize, default)
S3method(stdize, numeric)
S3method(stdize, logical)
S3method(stdize, factor)
S3method(stdize, data.frame)
S3method(stdize, formula)
S3method(stdize, matrix)

S3method(get.response, default)
S3method(get.response, lm)
S3method(get.response, averaging)
S3method(get.response, formula)

S3method(coefTable, bic.glm)

S3method(coefTable, glmmTMB)
S3method(coeffs, glmmTMB)
S3method(getAllTerms, glmmTMB)
S3method(makeArgs, glmmTMB)

S3method(loo, default)
S3method(loo, lm)

S3method(print, model.weights)
S3method("[", model.weights)

S3method(r.squaredGLMM, cplm)
S3method(r.squaredGLMM, glmmadmb)
S3method(r.squaredGLMM, glmmML)
S3method(r.squaredGLMM, glmmTMB)
S3method(r.squaredGLMM, lm)
S3method(r.squaredGLMM, lme)
S3method(r.squaredGLMM, merMod)

S3method(.numfixef, default)
S3method(.numfixef, glmmTMB)

S3method(.OLREFit, default)
S3method(.OLREFit, merMod)

S3method(.remodmat, default)
S3method(.remodmat, lme)
S3method(.remodmat, merMod)

S3method(.nullFitRE, default)
S3method(.nullFitRE, lme)

S3method(.varcorr, default)
S3method(.varcorr, glmmadmb)
S3method(.varcorr, glmmTMB)
S3method(.varcorr, lme)

S3method(sigma2, default)
S3method(sigma2, glmmPQL)
S3method(sigma2, glmmTMB)
S3method(sigma2, glmerMod)

S3method(.vcov, default)
S3method(.vcov, glmmTMB)
   
S3method(family, cplm)
S3method(family, glmmadmb)

S3method(sigma, glmmadmb)

S3method(coeffs, gamlss)
S3method(coefTable, gamlss)
S3method(getAllTerms, gamlss)
S3method(makeArgs, gamlss)
