1

I get the following error: Error in row.names<-.data.frame(*tmp*, value = value) : invalid 'row.names' length

Here is my script

library("RColorBrewer")
library("picante")
library("vegan")
library("ggplot2")

# read OTU data file for BB cultures
read.csv(file = "Heatmap_BB.csv", row.names = 1, header=TRUE, sep=",") -> BB

##creating the data tables for the heatmap.

BBnames <- BB[2:3] #here I assing the lables to be used later in one vector
hmBB <- BB[, 4:ncol(BB)] 

hmBBmatrix <- (BB[,4:ncol(BB)])
hmBBmatrix
rownames(hmBBmatrix) <- BBnames

Can anyone help?

emilliman5
  • 5,816
  • 3
  • 27
  • 37
Epilotus
  • 31
  • 2
  • 7
  • Please take a look at http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example, on how to make a reproducible example. – emilliman5 Jan 25 '17 at 23:13
  • It looks like you are trying to assign two columns to rownames (`BB[, 2:3]`). You need to `do.call(paste, BBnames)` the columns together and then it should work. – emilliman5 Jan 25 '17 at 23:21
  • Thanks emilliman5. It worked – Epilotus Feb 22 '17 at 19:11

0 Answers0