##linbreaks: a function allowing to obtain equidistant breaks
linbreaks<-function(x,n){
sort(round(seq(trunc(min(x)),
ceiling(max(x)+0.001),
length.out =unlist(n)+1),
1)
)
}
p<-expand.grid(c(12,15),c(15,20))
pl<-list(split(p[,1], seq(nrow(p))),
split(p[,2], seq(nrow(p))))
# Setting ncores=2 for this example check purpose
test<-candidates(fp1=matrix(rnorm(1000,52,15),ncol=10),
fp2=matrix(rpois(1000,50),ncol=10),
fun1=linbreaks,
fun2=linbreaks,
parlists=pl,
xcentering = FALSE,
xscaling = FALSE,
ncores=2)
str(test)
names(test)
# Example 2 from the spiceFP data
tpr.nclass=seq(10,16,2)
irdc.nclass=seq(20,24,2)
irdc.alpha=c(0.01,0.02,0.03)
p2<-expand.grid(tpr.nclass, irdc.alpha, irdc.nclass)
parlist.tpr<-split(p2[,1], seq(nrow(p2)))
parlist.irdc<-split(p2[,2:3], seq(nrow(p2)))
parlist.irdc<-lapply(
parlist.irdc,function(x){
list(x[[1]],x[[2]])}
)
m.irdc <- as.matrix(Irradiance[,-c(1)])
m.tpr <- as.matrix(Temperature[,-c(1)])
test2<-candidates(fp1=m.irdc,
fp2=m.tpr,
fun1=logbreaks,
fun2=linbreaks,
parlists=list(parlist.irdc,
parlist.tpr),
xcentering = TRUE,
xscaling = FALSE,
ncores=2)
length(test2$candidates)
class(test2$candidates)
#View(test2$candidates[[1]][[1]])
dim(test2$candidates[[1]][[1]])
test2$candidates[[1]][[2]]
# Closing the connections for the example check purpose
closeAllConnections()
Run the code above in your browser using DataLab