# \donttest{
dirOUTPUT <- system.file("data", package = "sephora")
BASIS <- drbasis(n=100, q=2)
polygon_deciduous <- deciduous_polygon
for(i in 1:nrow(polygon_deciduous)){
polygon_deciduous[i,] <- vecFromData(data=deciduous_polygon, numRow=i)$vec
}
# --- In the following example 'numCores=2' for CRAN
# --- testing purposes only. In a real life example
# --- users are encouraged to set 'numCores' to a number
# --- that reflects the size of their data set as well
# --- as the number of available cores
phenopar_polygon(data=polygon_deciduous,
product="independent",
numFreq = 3, distance = "dtw2",
samples=100, basis=BASIS,
k=3, numCores=2,
dirToSave=dirOUTPUT,
outputFileBaseName = "deciduous")
# --- Auxiliary function to read phenopar_polygon output,
# --- used below to define deciduous_params object
LoadToEnvironment <- function(RData, env = new.env()){
load(RData, env)
return(env)}
# --- colors used in spiralPlot below
cgu <- rgb(173/255,221/255,142/255)
csos <- rgb(120/255,198/255,121/255)
cmat <- rgb(49/255, 163/255,84/255)
csen <- rgb(217/255, 95/255, 14/255)
ceos <- rgb(254/255, 153/255, 41/255)
cdor <- rgb(208/255, 209/255, 230/255)
colores <- c(cgu,csos,cmat,csen,ceos,cdor)
# --- how to get a SpiralPlot
listRDatas <- list.files(path=dirOUTPUT,
pattern=".RData",
full.names=TRUE)
deciduous_params <- LoadToEnvironment(listRDatas[1])
getSpiralPlot(MAT=deciduous_params$output,
LABELS=month.name,
vp_param=list(width=0.5, height=0.7))
vcd::grid_legend(x=1.215, y=0.125, pch=18, col=colores,
frame=FALSE,
labels=c("GU","SoS","Mat","Sen","EoS","Dor"),
title="Params")
# --- cleaning up after work
unlink(paste0(dirOUTPUT, "/deciduous_phenoParams.RData"))
unlink(paste0(dirOUTPUT, "/phenopar_progress.txt"))# }
Run the code above in your browser using DataLab