# Methods needed from other packages
importFrom(stats, confint, fitted, coef, vcov, predict, update, profile,
           simulate, residuals, logLik, as.formula, binomial, cov, dbinom,
           dmultinom, dnbinom, dnorm, dpois, formula,
           glm.fit, integrate, median, model.frame,
           model.matrix, model.offset, na.omit, optim, pchisq, plogis,
           pnorm, qchisq, qnorm, quantile, rbinom,
           reshape, rmultinom, rnbinom, rpois, runif, sd, uniroot,
           update.formula)
importFrom(graphics, plot, hist, abline)
importFrom(utils, head, read.csv)
importFrom(plyr, ldply, alply, ddply)
importFrom(grDevices, devAskNewPage, dev.interactive)
importFrom(raster, raster, stack, extent, "extent<-", getValues)
importFrom(MASS, mvrnorm)
importFrom(parallel, detectCores, makeCluster, stopCluster, clusterExport,
           clusterEvalQ, parLapply)
importFrom(methods, is, as, new, show, slot, .hasSlot, callGeneric, 
           callNextMethod)
importFrom(lattice, xyplot, levelplot)
importFrom(Rcpp, evalCpp)

# Fitting functions
export(occu, occuFP, occuRN, pcount, pcountOpen, multinomPois, distsamp,
       colext, gmultmix, gdistsamp, gpcount, occuPEN, occuPEN_CV, occuMulti,
       occuMS, computeMPLElambda, pcount.spHDS, occuTTD, distsampOpen,
       multmixOpen)
export(removalPiFun, doublePiFun)
export(makeRemPiFun, makeCrPiFun, makeCrPiFunMb, makeCrPiFunMh)

# S4 classes
exportClasses(unmarkedFit, unmarkedFitOccu, unmarkedFitOccuFP, unmarkedFitDS,
              unmarkedFitPCount, unmarkedFitMPois, unmarkedFitPCO,
              unmarkedFrameDSO, unmarkedFitDSO,
              unmarkedFrameMMO, unmarkedFitMMO,
              unmarkedFitOccuMulti,
              unmarkedFrame, unmarkedFrameOccu, unmarkedFramePCount,
              unmarkedFrameMPois, unmarkedFrameDS, unmarkedMultFrame,
              unmarkedFrameGMM, unmarkedFrameGDS, unmarkedFramePCO,
              unmarkedFrameGPC, unmarkedEstimate, unmarkedFitList,
              unmarkedModSel, unmarkedRanef, unmarkedFrameOccuMulti,
              unmarkedFrameOccuMS, unmarkedCrossVal,
              unmarkedPostSamples)

# Methods
exportMethods(backTransform, coef, confint, coordinates, fitted, getData,
              getP, getFP, getB, getY, head, hessian, linearComb, mle,
              modSel, nllFun, numSites, numY, obsCovs, obsNum, "obsCovs<-",
              obsToY, "obsToY<-", parboot, plot, hist, predict, profile,
              projection, residuals, sampleSize, SE, show, simulate, siteCovs,
              "siteCovs<-", summary, update, vcov, yearlySiteCovs,
              "yearlySiteCovs<-", "[", smoothed, projected, nonparboot, logLik,
              LRT, ranef, bup, crossVal, posteriorSamples)

S3method("print", "unmarkedPostSamples")

# Constructors
export(unmarkedEstimate, fitList, mapInfo, unmarkedFrame,
    unmarkedFrameOccu, unmarkedFrameOccuFP, unmarkedFramePCount, unmarkedFrameMPois,
    unmarkedFrameDS, unmarkedMultFrame, unmarkedFrameGMM,
    unmarkedFramePCO, unmarkedFrameGDS, unmarkedFrameGPC, unmarkedFrameOccuMulti,
    unmarkedFrameOccuMS, unmarkedFrameOccuTTD, unmarkedFrameDSO, 
    unmarkedFrameMMO)

# Formatting
export(csvToUMF, formatLong, formatWide, formatMult, formatDistData)

# Misc
export(imputeMissing, gxhn, gxexp, gxhaz, dxhn, dxexp, dxhaz, drhn, drexp,
    drhaz, grhn, grexp, grhaz, sight2perpdist, lambda2psi, SSE, vif)

useDynLib("unmarked", .registration=TRUE)
