It seems that if your ts object doesn't populated at the very beginning of your time, the error Error in apply(y, 1L, rank) : dim(X) must have a positive length will be thrown.
like this:
testdata <- ts(data = as.vector(mydata$V4), start = c(2016,3), frequency = 12)
fit <- mlp(testdata)
Error in apply(y, 1L, rank) : dim(X) must have a positive length
It seems that if your ts object doesn't populated at the very beginning of your time, the error
Error in apply(y, 1L, rank) : dim(X) must have a positive lengthwill be thrown.like this: