Error in switch(class(arraydata), matrix = { : EXPR must be a vector of length 1

443 Views Asked by At

I would like to know if someone got a similar error using the ord function? My code hasn't worked since using the new version of R (4.0.2) and I wonder if it's associated with made4 updates?

I would really appreciate it if someone would give some hint

This is the problematic piece of code

res_coa <- ord(tdata, classvec=Species, type="coa")

where tdata is a matrix and Species a factor

1

There are 1 best solutions below

0
On BEST ANSWER

I had the same problem and I fixed it just converting my data into a data.frame. You can try something like:

res_coa <- ord(data.frame(tdata), classvec=Species, type="coa")