Frodo Baggings
Frodo Baggings

Reputation: 57

How can I visualise the distance matrix produced by vegdist in Vegan?

With the R package Vegan a distance matrix can be produced with the vegdist funciton:

distance.matrix <- vegdist(my.data)

I would like to actually show the distance matrix in a presentation to help explain what the NMDS plot of it is based on. How can I do this?

'distance.matrix' is 'Class 'dist' atomic...'. I just want to view it in a table showing how distant each site is from each other?

Upvotes: 1

Views: 3963

Answers (1)

Jari Oksanen
Jari Oksanen

Reputation: 3682

You want to see the distance matrix? What about typing its name?

distance.matrix
as.matrix(distance.matrix) # in full symmetric form

Or if you want to see it graphically, try

heatmap(as.matrix(distance.matrix))

Several packages probably have fancier tools.

Upvotes: 2

Related Questions