@@ -60,7 +60,7 @@ Type 'q()' to quit R.
6060> # For the other (non-NA) values, we get non-NA values back
6161> any(is.na(decostand(x, "clr", na.rm = FALSE, pseudocount = 1)[!is.na(x)])) == FALSE
6262[1] TRUE
63- > any(is.na(decostand(x, "clr", MARGIN = 2, na.rm = FALSE, pseudocount = 1)[!is.na(x)])) == FALSE
63+ > any(is.na(decostand(x, "clr", MARGIN = 2, na.rm = FALSE, pseudocount = 1)[!is.na(x)])) == FALSE
6464[1] TRUE
6565> # Results match for the non-NA values always (with tolerance 1e-6)
6666> inds <- !is.na(x) # Non-NA values
@@ -334,10 +334,14 @@ row18 -0.14885299
334334row19 0.91755915
335335row20 0.33766080
336336attr(,"scaled:center")
337- [1] -0.0031079619 -0.0463480942 -0.0267762284 0.0089869339 0.0380073003
338- [6] -0.0216677154 -0.0095070243 -0.0129853877 -0.0151765084 0.0739366224
339- [11] 0.0813752690 0.0153170116 -0.0001358339 -0.0203385433 -0.0102092705
340- [16] -0.0133788389 0.0543704488 -0.0876478093 0.0272043261 -0.0319186959
337+ row1 row2 row3 row4 row5
338+ -0.0031079619 -0.0463480942 -0.0267762284 0.0089869339 0.0380073003
339+ row6 row7 row8 row9 row10
340+ -0.0216677154 -0.0095070243 -0.0129853877 -0.0151765084 0.0739366224
341+ row11 row12 row13 row14 row15
342+ 0.0813752690 0.0153170116 -0.0001358339 -0.0203385433 -0.0102092705
343+ row16 row17 row18 row19 row20
344+ -0.0133788389 0.0543704488 -0.0876478093 0.0272043261 -0.0319186959
341345attr(,"decostand")
342346[1] "rclr"
343347> decostand(testdata, method = "clr", pseudocount = 1)
@@ -551,7 +555,7 @@ attr(,"decostand")
551555> #class(try(decostand(testdata, method = "clr"))) == "try-error"
552556> #class(try(decostand(testdata, method = "clr", pseudocount = 0))) == "try-error"
553557>
554- > # Tests that clr robust gives values that are approximately same if only
558+ > # Tests that clr robust gives values that are approximately same if only
555559> # one value per sample are changed to zero
556560> # Adds pseudocount
557561> test <- testdata + 1
@@ -828,10 +832,8 @@ col50 FALSE
828832>
829833> # Matrix completion
830834> x2c <- optspace(x2, ropt = 3, niter = 5, tol = 1e-5, verbose = FALSE)$M
831- > all(as.matrix(x1) == as.matrix(x2c))
832- [1] TRUE
833- >
834- > x2c <- optspace(x2, niter = 5, tol = 1e-5, verbose = FALSE)$M
835+ > x2c <- scale(x2c, center = TRUE, scale = FALSE)
836+ > x2c <- t(scale(t(x2c), center = TRUE, scale = FALSE))
835837> all(as.matrix(x1) == as.matrix(x2c))
836838[1] TRUE
837839>
@@ -875,4 +877,4 @@ col50 FALSE
875877>
876878> proc.time()
877879 user system elapsed
878- 0.438 0.048 0.485
880+ 0.436 0.048 0.481
0 commit comments