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 class 'metaMDS'
fortify(model, data, ...)

Arguments

model

an object of class "metaMDS", the result of a call to metaMDS.

data

currently ignored.

...

additional arguments passed to scores.metaMDS. Note you can't use display.

Value

A data frame in long format containing the ordination scores. The first two components are the axis scores.

Details

TODO

Author

Gavin L. Simpson

Examples

## load example data
data(dune)

ord <- metaMDS(dune)
#> Run 0 stress 0.1192678 
#> Run 1 stress 0.1192678 
#> ... Procrustes: rmse 3.906726e-05  max resid 9.79081e-05 
#> ... Similar to previous best
#> Run 2 stress 0.1183186 
#> ... New best solution
#> ... Procrustes: rmse 0.02026975  max resid 0.06495941 
#> Run 3 stress 0.1939202 
#> Run 4 stress 0.2066373 
#> Run 5 stress 0.1808911 
#> Run 6 stress 0.1183186 
#> ... Procrustes: rmse 2.245981e-06  max resid 7.540827e-06 
#> ... Similar to previous best
#> Run 7 stress 0.1183186 
#> ... Procrustes: rmse 4.917067e-06  max resid 1.600171e-05 
#> ... Similar to previous best
#> Run 8 stress 0.1183186 
#> ... New best solution
#> ... Procrustes: rmse 5.76826e-06  max resid 1.830903e-05 
#> ... Similar to previous best
#> Run 9 stress 0.119268 
#> Run 10 stress 0.1192678 
#> Run 11 stress 0.1183186 
#> ... New best solution
#> ... Procrustes: rmse 1.764602e-06  max resid 5.686181e-06 
#> ... Similar to previous best
#> Run 12 stress 0.1183186 
#> ... Procrustes: rmse 1.111141e-06  max resid 2.854289e-06 
#> ... Similar to previous best
#> Run 13 stress 0.1183186 
#> ... Procrustes: rmse 1.382648e-05  max resid 4.402376e-05 
#> ... Similar to previous best
#> Run 14 stress 0.2192919 
#> Run 15 stress 0.1192678 
#> Run 16 stress 0.1192678 
#> Run 17 stress 0.1192678 
#> Run 18 stress 0.1183186 
#> ... Procrustes: rmse 8.63055e-06  max resid 2.735838e-05 
#> ... Similar to previous best
#> Run 19 stress 0.1192678 
#> Run 20 stress 0.1183186 
#> ... Procrustes: rmse 2.414588e-06  max resid 6.802962e-06 
#> ... Similar to previous best
#> *** Best solution repeated 5 times
head(fortify(ord))
#>   score label       NMDS1       NMDS2
#> 1 sites     1 -0.84053640 -0.71584045
#> 2 sites     2 -0.50485269 -0.40893764
#> 3 sites     3 -0.08266724 -0.43667710
#> 4 sites     4 -0.11562068 -0.52224012
#> 5 sites     5 -0.62654396 -0.08669776
#> 6 sites     6 -0.54269432  0.11315518