Skip to content
Prev 378830 / 398502 Next

R Coding Help

We can see a few errors in what you have given us, but not enough to solve your problem as John indicates.

Looking at your Environment window, you have a data frame "phdtext" which is displayed in the upper left window. That appears to be a symmetrical 17 x 17 matrix so it is not clear why you are trying to create another one with the as.matrix(read.table()) command. It is not working because phDMatrix is empty as is phdDist.

Your first visible error message involves trying to install package vegan without using "vegan", i.e. install.packages("vegan"). That was not fatal because you were able to use library(vegan) to load it (i.e. you had already installed vegan). 

Based on these hints, the following code MIGHT work:

phdDist <- as.dist(phdtext)
phdMDS <- metaMDS(phdDist)

----------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77843-4352

-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of John Kane
Sent: Thursday, March 7, 2019 2:20 PM
To: Aryana Nabavizadeh <anabavizadeh at ucdavis.edu>
Cc: R. Help Mailing List <r-help at r-project.org>
Subject: Re: [R] R Coding Help

Thanks for the screenshot but it is not really all that useful. We
really need the actual code and some sample data.

Have a look at
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
or  http://adv-r.had.co.nz/Reproducibility.html for some suggesitions.

Providing the sample data in dput() format is the best way to supply it.

On Thu, 7 Mar 2019 at 13:19, Aryana Nabavizadeh
<anabavizadeh at ucdavis.edu> wrote:
nstructions.