0

I'm creating a CCA diagram in R using the vegan package. My row names are showing up as row1, row2, row3, etc. in the diagram, even though I have specified row.names = 1. I just don't seem to be able to get rid of them!

Code:

env.dat <- read.table("env.data.txt", header = TRUE, row.names = 1, sep= "\t") 

mod1.cca <- cca(spec.dat ~ soil.moisture + soil.pH + light + Light.transmission, data = env.dat) plot(mod1.cca, disp=c("wa", "sp", "bp"))

Any ideas?

BryanH
  • 5,826
  • 3
  • 34
  • 47
Bri
  • 1
  • 1
    Try `row.names(NAME_OF_DATASET) <- NULL` or replace NULL with a vector of new rownames. – stefan Oct 25 '20 at 11:48
  • thanks Stefan - tried that just - no luck! – Bri Oct 25 '20 at 12:48
  • Are you able to provide a small, reproducible example? This might help! – Fabio Marroni Oct 25 '20 at 13:01
  • env.dat <- read.table("env.data.txt", header = TRUE, row.names = 1, sep= "\t") mod1.cca <- cca(spec.dat ~ soil.moisture + soil.pH + light + Light.transmission, data = env.dat) plot(mod1.cca, disp=c("wa", "sp", "bp")) – Bri Oct 25 '20 at 13:45
  • the issue is definitely within the env.dat dataframe, as when only plotting my species data there is not this issue! – Bri Oct 25 '20 at 13:46
  • `dput` the data and add the code to your question. – Abdessabour Mtk Oct 25 '20 at 16:39
  • It's still not reproducible if we don't have the file you're reading. [See here](https://stackoverflow.com/q/5963269/5325862). By giving `row.names = 1`, you're saying the row names should come from the first column. I have no idea what you have there in your data, so it's unclear where `"row1"`, `"row2"` would come from – camille Oct 27 '20 at 15:11

0 Answers0