# NAMESPACE for AHMbook package

importFrom("grDevices", "colorRampPalette", "devAskNewPage",  "dev.interactive",
           "topo.colors", "adjustcolor", "rgb", "dev.cur")
importFrom("graphics", "abline", "barplot", "curve", "hist", "image",
           "lines", "matplot", "par", "plot", "points", "polygon", "mtext",
           "rect", "segments", "text", "title", "axis", "legend", "box")
importFrom("methods", "as", "is", "new")
importFrom("stats", "as.formula", "coef", "confint", "dbinom",
           "dnbinom", "dnorm", "dpois", "fitted", "integrate", "lm",
           "model.frame", "model.matrix", "model.offset", "optim",
           "plogis", "qlogis", "quantile", "rbinom", "residuals",
           "rexp", "rmultinom", "rnbinom", "rnorm", "rpois", "runif", "rlnorm",
           "var", "vcov", "cov2cor", "cor", "sd", "aggregate")
importFrom("utils", "head", "stack", "packageVersion", "data")

importFrom("unmarked", "unmarkedFrameOccu", "unmarkedFramePCount", "unmarkedFrameDS",
          "occuRN", "bup", "ranef", "coef", "fitted", "residuals", "vcov", "confint")
# importFrom("plotrix", "draw.circle") # Now in file draw_circle.R
# importFrom("RandomFields", "RFoptions", "RFsimulate", "RMexp")
#importFrom("fields",  "circulantEmbeddingSetup", "circulantEmbedding")
#importFrom("sp", "bubble", "coordinates<-")
#importFrom("coda", "crosscorr")
importFrom("mvtnorm", "dmvnorm")


# Introduction
export("sim.fn")  # AHM1/1
export("data.fn")  # AHM1/4

# Abundance from Counts: Binomial N-Mixture models
export("simNmix", "simpleNmix", "playRN")  # AHM1/6


# Abundance from Hierarchical Distance Sampling
export("sim.ldata", "sim.pdata", "simHDS", "simHDSpoint")  # AHM1/8
export("simHDSg", "simHDStr", "simHDSopen", "issj.sim", "sim.spatialDS", "sim.spatialHDS")  # AHM1/9
export("simIDS")   # bonus

# Static Occurence using Site-Occupancy Models
export("simOcc", "sim3Occ", "simOccttd", "wigglyOcc") # AHM1/10
export("simOccCat")  # bonus

# Hierarchical Models for Communities
export("simComm")  # AHM1/11

# Relative Abundance Models for Population Dynamics
export("simNpC", "simPH", "simPOP")  # AHM2/1

# Modeling Population Dynamics with Count Data
export("simDM0", "simDM", "simMultMix", "simFrogDisease")  # AHM2/2

# Hierarchical Models of Survival
export("simCJS")  # AHM2/3

# Dynamic Occupancy Models
export("simDynocc", "simDemoDynocc")  # AHM2/4

# Dynamic Community Models
export("simDCM")  # AHM2/5

# Spatial Models of Distribution and Abundance
export("simDynoccSpatial", "simExpCorrRF")  # AHM2/9

# Integrated Models for Multiple Types of Data
export("simPPe", "simDataDK", "simDataDK1")  # AHM2/10

# Spatially Explicit Distance Sampling
export("simSpatialDSline", "simSpatialDSte", "simNmixSpatial",
    "simOccSpatial", "simDSM")  # AHM2/11

# Utilities
export("ppc.plot", "map.Nmix.resi", "plot_Nmix_resi")       # AHM1/6
export("fitstats", "fitstats2")                             # AHM1/7
export("crPiFun", "crPiFun.Mb", "MhPiFun", "instRemPiFun")  # AHM1/7
export("spline.prep")                                       # AHM1/10
export("graphSSM")                                          # AHM2/1
export("ch2marray")                                         # AHM2/3
export("valid_data", "modSelFP")                            # AHM2/7
export("getLVcorrMat", "getEcorrMat")                       # AHM2/8
export("zinit")
export("bigCrossCorr")
export("standardize", "standardize2match")
export("e2dist")
export("image_scale")

# Color ramps
export("rampYOR", "rampGreens",  "rampGreys", "rampBYR", "rampGBr")
