I am trying to coerce a distance matrix from QIIME2 to class dist
in R. Upstream processing up to the generation of the distance matrix was performed as described in the QIIME2 document "Moving Pictures". When I call as.dist
, I get the following warning messages:
imported_dist_matrix <- as.dist(dist_bray_df)
## Warning messages:
## 1: In storage.mode(m) <- "numeric" : NAs introduced by coercion
## 2: In as.dist.default(dist_bray_df) : non-square matrix
imported_dist_matrix <- as.dist(dist_bray)
## Warning messages:
## 1: In storage.mode(m) <- "numeric" : NAs introduced by coercion
## 2: In as.dist.default(dist_bray) : non-square matrix
I do not know why the distance matrix is non-square:
print(dist_bray)
## A tibble: 130 × 131
## ...1 1-12-…¹ 1-12-…² 1-12-…³ 1-8-3…⁴ 1-8-3…⁵ 1-8-3…⁶ 2-21-…⁷ 2-21-…⁸ 2-21-…⁹ 3-15-…˟ 3-15-…˟
## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 1-12-43-… 0 0.462 0.552 0.716 0.996 0.918 0.755 0.649 0.671 0.664 0.712
I want a dist
object so that I can pass it to metaMDS
, and so on.