I was trying to do a regular simplex (the notion of a triangle or tetrahedron to arbitrary dimensions) to start an optimization set of experiments. The Optimsimplex package provides an easy and useful way to achieve this by using the Spendley method:
library('optimsimplex') #Paquete necesario
Ultra <- optimsimplex(method ='spendley',
x0=c(Vhno3=3,Vh2o2=1,Msample=300,Tsonic=15))
The result Ultra
is a optimsimplex class object containing the spatial dimension (n), and the (n) coordenates for each (n+1) vertexes. It is possible to specify a dimension (length) of the simplex by using the len option:
len: The dimension of the simplex. If length is a value, that unique length is used in all directions. If length is a vector with n values, each length is used with the corresponding direction. Only used if method is set to ’axes’ or ’spendley’
But this result on a error that I can not understand:
Ultra <- optimsimplex(method ='spendley',
x0=c(Vhno3=3,Vh2o2=1,Msample=300,Tsonic=15),
len=c(pVhno3=0.5,pVh2o2=0.25,pMsample=50,pTsonic=5))
Error: optimsimplex: The len vector is expected to be a row matrix, but current shape is 1 x 4
So, a 1 x 4 is not a row matrix as {optimsimplex} expected? Could this perhaps correspond to some kind of bug in the package? Thanks in advance.
The problem gets solved by using the new version of optimsimplex package
which according to Sebastien Bihorel will be available soon on CRAN but is currently aviable on Optimsimplex-Github