#NEED to work out how to compile
#with imports

#imports

#currently library loaded
#so user/examples accessible

#seems to need these imported as well as depends
import(lattice)
import(loa)

#requested by CRAN
importFrom("grDevices", "colorRampPalette", "gray")
importFrom("graphics", "abline", "arrows", "plot")
importFrom("methods", "is")
importFrom("stats", "aggregate", "as.formula", "ccf", "model.frame",
           "na.omit", "na.pass")
importFrom("utils", "read.csv", "read.delim", "write.table")


#imported packages 
#import(utils) #just importing head and tail methods
import(grid)
import(RColorBrewer)
import(latticeExtra)
#import(ggplot2) #just importing fortify
import(plyr)


#front.of.house

#make.pems
export(is.pems)
export(pems)
export(pems.element)
export(isPEMS) 
export(makePEMS)
export(makePEMSElement)
export(as.pems)

S3method(as.pems, default)
S3method(as.pems, data.frame)

#import.pems
export(import2PEMS) 
export(importTAB2PEMS) 
export(importCSV2PEMS) 
export(importOBS2PEMS) 
export(importOB12PEMS) 
export(importParSYNC2PEMS)
export(importCAGE2PEMS)
export(importRoyalTek2PEMS) 

#structure
export(pemsElement)
export(pemsData)
export(pemsConstants)
export(pemsHistory)

#merge.pems
export(align)
export(cAlign)
export(findLinearOffset)
export(tAlign)
#bindPEMS

#export
export(exportPEMSData)


#generic.pems.handlers

#imports for non-base
importFrom(utils,head)
importFrom(utils,tail)

S3method(as.data.frame, pems)
S3method(dim, pems)
###### dim does these
#S3method(nrow, pems)
#S3method(ncol, pems)
######
S3method("$", pems)
S3method("$<-", pems)
S3method("[", pems)
S3method("[<-", pems)
S3method("[[", pems)
S3method("[[<-", pems)
S3method(print, pems)
S3method(plot, pems)
S3method(names, pems)
S3method("names<-", pems)
S3method(head, pems)
S3method(tail, pems)
S3method(summary, pems)
S3method(units, pems)
S3method("units<-", pems)
S3method(with, pems)
S3method(subset, pems)

S3method("[", pems.element)
S3method("[<-", pems.element)
S3method(as.data.frame, pems.element)
S3method(print, pems.element)
S3method(plot, pems.element)
S3method(units, pems.element)
S3method("units<-", pems.element)
S3method(summary, pems.element)

###########################
#imported whole thing above
#need for head and tail
##importFrom(utils,head)
##importFrom(utils,tail)
###########################

#plots
export(latticePlot)
export(panel.PEMSXYPlot)
export(XYZPlot)
export(pemsPlot)
export(panel.pemsPlot)
export(preprocess.pemsPlot)
export(pemsXYZCondUnitsHandler)
export(WatsonPlot)
export(preprocess.WatsonPlot)
export(panel.WatsonBinPlot)
export(panel.WatsonContourPlot)
export(panel.WatsonSmoothContourPlot)


#need for ggplot2 add-in
S3method(fortify, pems)
importFrom(ggplot2, fortify)

#calcs
export(calcDistance)
export(calcSpeed)
export(calcAccel)
export(calcAcceleration)
export(calcJerk)
export(calcVSP)
export(calcVSPJimenezPalaciosCMEM)
export(calcEm)
export(calcEmHoribaPitot)

#calc handlers
export(calcChecks)
export(calcPack)

#corrections
export(calcPack2)
export(correctInput)
export(zeroNegatives)

#cutBy
export(cutBy)
export(cutByRow)

#unit.handlers

export(getUnits) 
export(setUnits) 
export(convertUnits)
export(addUnitConversion)
export(addUnitAlias)
export(listUnitConversions)

#summaryReports
export(summaryReport) 

#check...functions
export(checkInput) 
export(checkOption) 
export(checkPEMS) 
export(checkUnits) 
export(checkOutput)
export(checkIfMissing)
