import(splines)
import(MASS)
import(nlme)
importFrom("grDevices", "grey","adjustcolor","colorRampPalette")
importFrom("graphics", "abline", "axis", "box", "lines", "matlines",
             "matplot", "par", "plot", "points", "polygon", "segments","smoothScatter",
           "legend","mtext", "text", "rect", "arrows")
importFrom("stats", "spline", "approx", "as.formula", "coef", "contrasts", "family",
             "fitted", "formula", "gaussian", "glm.control", "glm.fit",
             "is.empty.model", "lm.wfit", "median", "model.frame",
             "model.matrix", "model.offset", "model.response",
             "model.weights", "na.omit", "pnorm", "predict",
             "printCoefmat", "pt", "qnorm", "qt", "quantile", "resid",
             "residuals", "runif", "summary.glm", "summary.lm", "update",
             "update.formula", "vcov", "weights", "dnorm", "lm", "lm.fit", "splinefun",
             "complete.cases","sd","qchisq","pchisq","BIC","get_all_vars", "optimize", 
             "terms","is.ts", "tsp", "AIC",".lm.fit","var",
	           "asOneSidedFormula", "logLik","plogis", ".getXlevels", 
             "cov2cor", "glm", "uniroot","delete.response","weighted.mean","reformulate","sigma", "cor")

importFrom("utils", "flush.console", "capture.output")

export(segreg, seg, segmented, segmented.default, segmented.lm, segmented.glm, segmented.Arima, segmented.numeric, 
	segmented.lme, print.segmented.lme, summary.segmented.lme, vcov.segmented.lme, confint.segmented.lme, 
	logLik.segmented.lme, fixef.segmented.lme, fitted.segmented.lme, plot.segmented.lme,
	broken.line ,confint.segmented,davies.test,pscore.test,draw.history,aapc,
	intercept,lines.segmented,plot.segmented,print.segmented, coef.segmented,
	seg.control,seg.lm.fit,seg.glm.fit,seg.lm.fit.boot,seg.glm.fit.boot,
	seg.def.fit,seg.def.fit.boot, seg.Ar.fit,seg.Ar.fit.boot,
	seg.num.fit, seg.num.fit.boot,
	slope, summary.segmented, print.summary.segmented, vcov.segmented, predict.segmented, 
	points.segmented, aapc, selgmented, pwr.seg, model.matrix.segmented)

export(stelpmented, stepreg, stepmented, stepmented.lm, stepmented.glm, stepmented.ts, stepmented.numeric,
       step.lm.fit, step.glm.fit, step.ts.fit, step.num.fit, 
       step.lm.fit.boot, step.glm.fit.boot, step.ts.fit.boot, step.num.fit.boot,
       summary.stepmented, print.summary.stepmented, print.stepmented,
       plot.stepmented, vcov.stepmented, model.matrix.stepmented, predict.stepmented)


S3method(segmented,default)
S3method(segmented,lm)
S3method(segmented,glm)
S3method(segmented,Arima)
S3method(segmented,numeric)
S3method(segmented,lme)
S3method(plot,segmented)
S3method(print,segmented)
S3method(summary,segmented)
S3method(print, summary.segmented)
S3method(lines,segmented)
S3method(confint,segmented)
S3method(vcov,segmented)
S3method(predict,segmented)
S3method(points,segmented)
S3method(coef,segmented)
S3method(model.matrix,segmented)

S3method(print, segmented.lme)
S3method(summary, segmented.lme)
S3method(vcov, segmented.lme)
S3method(confint, segmented.lme)
S3method(logLik, segmented.lme)
S3method(fixef, segmented.lme)
S3method(fitted, segmented.lme)
S3method(plot, segmented.lme)

#S3method(stepmented,default)
S3method(stepmented,lm)
S3method(stepmented,glm)
S3method(stepmented,ts)
S3method(stepmented,numeric)
#S3method(stepmented,Arima)
S3method(plot,stepmented)
S3method(print,stepmented)
S3method(summary,stepmented)
S3method(print, summary.stepmented)
S3method(confint,stepmented)
S3method(lines,stepmented)
S3method(model.matrix,stepmented)
S3method(predict,stepmented)