useDynLib(spdep)

import(spData)
import(sf)
importFrom(sp, CRS, Line, Lines, SpatialLines, SpatialLinesDataFrame, bbox, coordinates, geometry, get_ll_TOL, is.projected, spDists)
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",
             "pbinom", "coef", "C", "contrasts")

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, terrain.colors)
if (getRversion() >= "3.6.0") {
    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,
	addlinks1)

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,
        read.swmdbf2listw, read_swm_dbf, write.swmdbf, write_swm_dbf, write.sn2DBF,
        lm.LMtests, lm.RStests,
	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,
	plot.nb, edit.nb, subset.nb, subset.listw,
	plot.Gabriel, plot.relative, print.jclist,
	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,
        remove.self)

export(have_factor_preds_mf, warn_factor_preds, SD.RStests)

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(localGS)

export(localC, localC_perm)
export(hotspot)

export(grid2nb)

export(autocov_dist)

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

export(localmoran_bv, moran_bv,local_joincount_uni, local_joincount_bv)

export(licd_multi)

export(spatialdelta, linearised_diffusive_weights, metropolis_hastings_weights,
        iterative_proportional_fitting_weights, graph_distance_weights)
export(plot_spatialcoords, plot_moran, plot_spatialscree, localdelta,
        factorial_coordinates, plot_factorialcoords, plot_factorialscree,
        cornish_fisher)

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

S3method(summary, listw)
S3method(print, 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, RStestlist)
S3method(summary, RStestlist)
S3method(print, RStestlist.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)

S3method(hotspot, default)
S3method(hotspot, localmoran)
S3method(hotspot, summary.localmoransad)
S3method(hotspot, data.frame.localmoranex)
S3method(hotspot, localC)
S3method(hotspot, localG)
S3method(hotspot, licd)

S3method(summary, spatialdelta)
S3method(print, summary.spatialdelta)
S3method(plot_spatialcoords, default)
S3method(plot_spatialcoords, spatialdelta)
S3method(plot_moran, default)
S3method(plot_moran, spatialdelta)
S3method(plot_spatialscree, default)
S3method(plot_spatialscree, spatialdelta)
S3method(factorial_coordinates, default)
S3method(factorial_coordinates, spatialdelta)
S3method(plot_factorialcoords, default)
S3method(plot_factorialcoords, spatialdelta)
S3method(plot_factorialscree, default)
S3method(plot_factorialscree, spatialdelta)
S3method(localdelta, default)
S3method(localdelta, spatialdelta)
S3method(cornish_fisher, default)
S3method(cornish_fisher, spatialdelta)
S3method(as.matrix, adjusted_spatial_weights)


