Skip to content
Prev 54286 / 63424 Next

Cannot Compute Box's M (Three Days Trying...)

On 28/10/2017 7:12 AM, Morkus wrote:
That looks like an error occurring in the str() function.  I've never 
seen such a think in a regular R session, so I would guess that either 
your boxMVariable object is set up in a weird way that is confusing 
str(), or your R session in Java is messed up.

This is likely to be pretty hard to debug.  As a general strategy, I'd 
try to find out exactly what is in boxMVariable first.  Since str() 
doesn't work, try printing things like

head(boxMVariable)
class(boxMVariable)
names(boxMVariable)
ncol(boxMVariable)
nrow(boxMVariable)
typeof(boxMVariable)
for (i in 1:5)
   print(typeof(boxMVariable[[i]]))

etc.

Make sure the values match what you see in a regular R session:

 > boxMVariable <- iris
 >
 > head(boxMVariable)
   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1          5.1         3.5          1.4         0.2  setosa
2          4.9         3.0          1.4         0.2  setosa
3          4.7         3.2          1.3         0.2  setosa
4          4.6         3.1          1.5         0.2  setosa
5          5.0         3.6          1.4         0.2  setosa
6          5.4         3.9          1.7         0.4  setosa
 > class(boxMVariable)
[1] "data.frame"
 > names(boxMVariable)
[1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width" 
"Species"
 > ncol(boxMVariable)
[1] 5
 > nrow(boxMVariable)
[1] 150
 > typeof(boxMVariable)
[1] "list"
 > for (i in 1:5)
+   print(typeof(boxMVariable[[i]]))
[1] "double"
[1] "double"
[1] "double"
[1] "double"
[1] "integer"
Message-ID: <ee03e49f-9c97-5e34-d12e-7623effcf062@gmail.com>
In-Reply-To: <rl0BFmHLQl4yweaOtoWaJJEScu0VetftcUuusTtgU1qjAdU-8pgrnohMfnzvJQZTY2jPjjraq6xgDDAlxfHHZunKbfGydZILJQ8xk4g0IWc=@protonmail.com>