"mataMDS"
object.fortify.metaMDS.Rd
Fortifies an object of class "metaMDS"
to produce a
data frame of the selected axis scores in long format, suitable for
plotting with ggplot
.
# S3 method for metaMDS
fortify(model, data, ...)
an object of class "metaMDS"
, the result of a call
to metaMDS
.
currently ignored.
additional arguments passed to
scores.metaMDS
. Note you can't use display
.
A data frame in long format containing the ordination scores. The first two components are the axis scores.
TODO
## load example data
data(dune)
ord <- metaMDS(dune)
#> Run 0 stress 0.1192678
#> Run 1 stress 0.1192678
#> ... Procrustes: rmse 3.703359e-05 max resid 0.0001138414
#> ... Similar to previous best
#> Run 2 stress 0.1192679
#> ... Procrustes: rmse 5.508179e-05 max resid 0.0001604151
#> ... Similar to previous best
#> Run 3 stress 0.1183186
#> ... New best solution
#> ... Procrustes: rmse 0.02027046 max resid 0.06496315
#> Run 4 stress 0.1183186
#> ... New best solution
#> ... Procrustes: rmse 5.643524e-06 max resid 1.765415e-05
#> ... Similar to previous best
#> Run 5 stress 0.1808911
#> Run 6 stress 0.1183186
#> ... Procrustes: rmse 3.604315e-06 max resid 1.201824e-05
#> ... Similar to previous best
#> Run 7 stress 0.1192678
#> Run 8 stress 0.1886532
#> Run 9 stress 0.1808911
#> Run 10 stress 0.1192678
#> Run 11 stress 0.1183186
#> ... Procrustes: rmse 9.713054e-07 max resid 3.177083e-06
#> ... Similar to previous best
#> Run 12 stress 0.1183186
#> ... Procrustes: rmse 6.211937e-06 max resid 2.017492e-05
#> ... Similar to previous best
#> Run 13 stress 0.1183186
#> ... Procrustes: rmse 2.197547e-06 max resid 5.86895e-06
#> ... Similar to previous best
#> Run 14 stress 0.1192679
#> Run 15 stress 0.1183186
#> ... Procrustes: rmse 2.673278e-05 max resid 8.196247e-05
#> ... Similar to previous best
#> Run 16 stress 0.1192678
#> Run 17 stress 0.1183186
#> ... Procrustes: rmse 5.37186e-06 max resid 1.493921e-05
#> ... Similar to previous best
#> Run 18 stress 0.1192679
#> Run 19 stress 0.1192679
#> Run 20 stress 0.1183186
#> ... Procrustes: rmse 5.349388e-06 max resid 1.625857e-05
#> ... Similar to previous best
#> *** Best solution repeated 8 times
head(fortify(ord))
#> score label NMDS1 NMDS2
#> 1 sites 1 -0.84055052 -0.7158230
#> 2 sites 2 -0.50485325 -0.4089361
#> 3 sites 3 -0.08267127 -0.4366745
#> 4 sites 4 -0.11562689 -0.5222374
#> 5 sites 5 -0.62654535 -0.0866940
#> 6 sites 6 -0.54270079 0.1131546