# NOT RUN {
# }
# NOT RUN {
## Interactive sites selection:
# ID=pfInteractive()
## Site selection using criterions
# Boreal Eastern North American sites with at least one
# dating point each 2500 year
ID=pfSiteSel(lat>50, lat<70, long>-90, long<(-50), date_int<=2500, l12==1)
plot(ID,zoom="world")
## Modify plot
plot(ID,zoom="sites")
## Simple test for transforming data
# Select site 1 (Cygnet Lake)
ID1=pfSiteSel(id_site==1)
plot(ID1)
# Transformation of data
TR=pfTransform(ID1,method=c("MinMax", "Box-Cox", "Z-Score"))
# Plot Transformed and raw data
# First retrieve raw data for Cygnet using pfExtract
RAW=pfExtract(ID=1)
dev.off()
par(mfrow=(c(2,1)))
plot(RAW[,3],RAW[,4],type="l")
plot(TR$Age,TR$TransData,type="l")
## Transforming and Compositing
## Example 1: Usage as in Power et al. 2008
## Data transformation
TR1=pfTransform(ID, method=c("MinMax","Box-Cox","Z-Score"),BasePeriod=c(200,2000))
## Diagnostic pdf file with transformed series:
# pfDiagnostic(ID, method=c("MinMax","Box-Cox","Z-Score"),BasePeriod=c(200,2000),
# FileName = "Diagnostic.pdf")
## Compositing: basic binning procedure
COMP=pfComposite(TR1, binning=TRUE, bins=seq(0,8000,500))
plot(COMP)
## The result matrix can be saved
# write.csv(COMP$Result,file="temp.csv")
## Compositing: Using the locfit package equivalent procedure to Daniau et al. 2012
COMP2=pfCompositeLF(TR1, tarAge=seq(-50,8000,20), binhw=20, hw=500,nboot=100)
plot(COMP2)
## And save
write.csv(COMP2$Result,file="temp2.csv")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab