useDynLib(spdep)

import(spData)
import(sf)
import(sp)
import(methods)

importFrom(stats, influence.measures, lag, punif, lm, var, integrate,
             summary.lm, pchisq, pnorm, sd, ppois, qnorm, rnorm,
             mahalanobis, dist, p.adjust, density, quantile, cor,
             aggregate, "coefficients", "fitted", "gaussian",
             "model.frame", "model.matrix", "model.response", "na.fail",
             "na.omit", "naresid", "optimise", "printCoefmat", "resid",
             "terms", "uniroot", "weighted.residuals", "weights", "median")

importFrom(deldir, deldir)
importFrom(boot, boot)

importFrom(graphics, par, locator, lines, text, plot.new, plot.window, segments, points, identify, symbols, abline, hist, arrows, axis, stem)
importFrom(utils, write.table, object.size, read.table, read.csv, packageDescription)
importFrom(grDevices, hcl.colors)
if (.Platform$OS.type == "windows") importFrom(grDevices, bringToTop)
importFrom(utils, packageVersion)
importFrom(units, set_units)
importFrom(s2, s2_distance, s2_closest_edges, s2_buffer_cells, s2_intersects_matrix, s2_dwithin_matrix)
importFrom(e1071, skewness, kurtosis)


exportMethods(coerce)

export(EBImoran.mc, probmap, choynowski, EBest, EBlocal)

export(airdist, card, cell2nb, vi2mrc, n.comp.nb, diffnb, dnearneigh, droplinks)

export(gabrielneigh, geary.test, geary, geary.mc, globalG.test, graph2nb, 
	joincount.test, joincount.mc, joincount.multi, print.jcmulti,
	knearneigh, knn2nb)

export(listw2sn, sn2listw, read.gwt2nb,	write.sn2gwt, lm.LMtests, 
	lm.morantest, localG, localG_perm, localmoran, localmoran_perm, moran,
	moran.test, moran.mc, moran.plot, localmoran.sad, lm.morantest.sad,
	nb2listw, nb2listwdist, nb2mat, listw2mat, mat2listw, nbdists, nblag,
	nblag_cumul, poly2nb, read.gal, write.nb.gal, read.geoda, relativeneigh,
	soi.graph, sp.correlogram, sp.mantel.mc, set.spChkOption, chkIDs,
	get.spChkOption, spNamedVec, tri2nb,
	spweights.constants, lag.listw, listw2U, listw2star, is.symmetric.nb,
	sym.attr.nb, include.self, make.sym.nb, union.nb, intersect.nb,
	setdiff.nb, complement.nb, Szero, spdep, print.nb, summary.nb, 
	plot.nb, edit.nb, subset.nb, summary.listw, print.listw, subset.listw,
	plot.Gabriel, plot.relative, print.jclist, print.LMtestlist, 
	plot.mc.sim, as.data.frame.localmoransad, print.localmoransad, 
	summary.localmoransad, print.summary.localmoransad, print.moransad, 
	summary.moransad, print.summary.moransad, print.spcor, plot.spcor)

export(write.sn2dat, read.dat2listw, nb2blocknb, p.adjustSP,
	is.symmetric.glist, nb2lines, listw2lines, df2sn, 
	plot.listw, aggregate.nb, old.make.sym.nb)

export(nb2WB, listw2WB, nb2INLA)

export(lm.morantest.exact, print.moranex, localmoran.exact, localmoran.exact.alt, print.localmoranex, as.data.frame.localmoranex)

export(mstree, nbcosts, nbcost, plot.mst, plot.skater, prunecost, ssw, prunemst, skater)

export(tolerance.nb, Rotation)

export(lee.mc, lee, lee.test)

export(LOSH, LOSH.cs, LOSH.mc)

export(localC, localC_perm)

export(grid2nb)

export(autocov_dist)

export(set.VerboseOption, get.VerboseOption, set.ZeroPolicyOption, 
        get.ZeroPolicyOption)
export(set.mcOption, get.mcOption, set.coresOption, get.coresOption,
        set.ClusterOption, get.ClusterOption)



S3method(print, nb)
S3method(summary, nb)
S3method(plot, nb)
S3method(edit, nb)
S3method(subset, nb)
S3method(aggregate, nb)

S3method(summary, listw)
S3method(print, listw)
S3method(plot, listw)
S3method(subset, listw)
S3method(lag, listw)

S3method(plot, Gabriel)
S3method(plot, relative)

S3method(print, jclist)
S3method(print, jcmulti)
S3method(print, LMtestlist)
S3method(summary, LMtestlist)
S3method(print, LMtestlist.summary)
S3method(plot, mc.sim)

S3method(as.data.frame, localmoransad)
S3method(print, localmoransad)
S3method(summary, localmoransad)
S3method(print, summary.localmoransad)

S3method(print, moransad)
S3method(summary, moransad)
S3method(print, summary.moransad)

S3method(print, moranex)
S3method(print, localmoranex)
S3method(as.data.frame, localmoranex)

S3method(print, spcor)
S3method(plot, spcor)

S3method(plot, mst)
S3method(plot, skater)

S3method(localC, default)
S3method(localC, formula)
S3method(localC, list)
S3method(localC, matrix)
S3method(localC, data.frame)
S3method(localC_perm, default)
S3method(localC_perm, formula)
