title: 'row names containing missing values' error when using HSD.test
body: <p>I'm trying to obtain means identified by different letters when they are significantly different. </p>
  
  <p>When I use <code>HSD.test</code>I get the following error:</p>
  
  <pre><code>&gt; aov1 &lt;- aov(S ~ TAMBO, data=base)
  &gt; summary(aov1)
                 Df Sum Sq Mean Sq F value   Pr(&gt;F)    
   TAMBO           5    216   43.26   9.197 9.44e-09 ***
   Residuals   14091  66281    4.70                     
   ---
   Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
   14 observations deleted due to missingness
  &gt; hsdst &lt;- HSD.test(aov1,"TAMBO", console=TRUE)
  
   Study: aov1 ~ "TAMBO"
  
   HSD Test for S 
  
   Mean Square Error:  4.703751 
  
   TAMBO,  means
  
   Error in data.frame(row.names = means[, 1], means[, -1]) : 
   row names contain missing values
  </code></pre>
  
  <p>I have tried <code>make.names(base, unique=TRUE)</code>and <code>rownames(base) &lt;- NULL</code>but nothing seems to work. Also, when I used <code>TukeyHSD(aov1)</code>it worked fine. I've been the last ten hours with this, it's driving me crazy.</p>
  
  <p>Any input will be greatly appreciated.</p>
  
  <p>EDIT: I have also used <code>lm</code>instead of <code>aov</code>. It made no difference.</p>
  
  <p>EDIT 2: Here is <code>dput(head(base))</code>:</p>
  
  <pre><code>structure(list(TAMBO = structure(c(6L, 6L, 2L, 6L, 2L, 4L), .Label = c("", 
  "AGR", "ER", "LE", "SN", "TLH"), class = "factor"), RP = structure(c(1013L, 
  1136L, 228L, 1296L, 1237L, 1492L), .Label = c("", "  5 G", " E831", 
  "1", "10", "100", "100-0002-01 - LA JOSEFA           ", "100-0007-01 - EL      REJUNTE          ", 
  "100-0019-01 - FAC.CIENCIAS AGRP. ", "100-0036-01 - LA EFIGENIA         ", 
  "1000", "1003", "1004", "1010", "1015", "1018", "102", "1020", 
  "1021", "1027", "1031", "104", "106", "107", "108", "1083", "1084", 
  "1088", "109", "1097", "11", "110", "1100", "1106", "111", "112", 
  "1127", "114", "1149", "115", "1150", "116", "1161", "1162", 
  "117", "118", "119", "1197", "12", "120", "1202", "1209", "121", 
  "1210", "1212", "1215", "1219", "122", "1229", "123", "124", 
  "1240", "125", "1250", "1254", "1258", "126", "1260", "127", 
  "1275", "128", "1284", "1287", "129", "1295", "1298", "1299", 
  "13", "130", "1300", "1302", "1304", "131", "132", "1326", "133", 
  "1330",  "881", "882", "883", "884", 
  "885", "886", "89", "890", "892", "893", "894", "895", "896", 
  "899", "9", "90", "900", "91", "92", "93", "94", "944", "96", 
  "960", "97", "971", "979", "9794", "98", "980", "988", "99", 
  "9929"), class = "factor"), FECHA.NAC = structure(c(36L, 774L, 
  554L, 398L, 1051L, 1L), .Label = c("", "00/00/00 ", "1980-05-20", 
  "1980-06-05", "1980-11-15", "1981-06-15", "1983-08-12", "1983-08-20",       "2006-04-01", "2006-04-20", 
  "2006-04-25", "2006-05-03", "2006-05-10", "2006-05-20", "2006-06-09", 
  "2006-06-14", "2006-07-10", "2006-08-06", "2006-11-04", "2006-12-03", 
  "2006-12-15", "2007-02-17", "2007-03-01", "2007-07-05", "31/11/02 "
  ), class = "factor"), NP = c(5L, 1L, 2L, 7L, 3L, 3L), NP.AGRUPADO = c(4L, 
  1L, 2L, 4L, 3L, 3L), PARTO = structure(c(412L, 1962L, 1688L, 
  2859L, 3106L, 3106L), .Label = c("1990-10-02", "1990-12-02", 
  "1991-01-22", "1991-04-30", "1991-05-08", "1991-05-09", "1991-05-24", 
  "1991-06-02", "1991-06-04", "1991-06-17", "1991-06-18", "1991-07-04", 
  "1991-07-12", "1991-07-21", "1991-08-07", "1991-08-13", "1991-08-16", 
  "1991-08-17", "1991-08-22", "1991-08-23", "1991-08-24", "1991-08-27", 
  "1991-08-29", "1991-09-06", "1991-09-07", "1991-09-16", "1991-09-26", 
  "2013-03-26", "2013-03-28", "2013-04-01", "2013-04-02", "2013-04-03", 
  "2013-04-04", "2013-04-05", "2013-04-06", "2013-04-07", "2013-04-08", 
  "2013-04-09", "2013-04-11", "2013-04-13", "2013-04-15", "2013-04-16", 
  "2013-04-17", "2013-04-18", "2013-04-19", "2013-04-20", "2013-04-22", 
  "2013-04-23", "2013-04-25", "2013-04-26", "2013-04-27", "2013-04-28", 
  "2013-04-29", "2013-04-30", "2013-05-01", "2013-05-02", "2013-05-04", 
  "2013-05-05", "2013-05-06", "2013-05-07", "2013-05-09", "2013-05-10", 
  "2013-05-11", "2013-05-12", "2013-05-13", "2013-05-14", "2013-05-15", 
  "2013-05-16", "2013-05-17", "2013-05-18", "2013-05-19", "2013-05-20", 
  "2013-05-21", "2013-05-22", "2013-05-23", "2013-05-24", "2013-05-26", 
  "2013-05-27", "2013-05-28", "2013-05-29", "2013-05-30", "2013-05-31", 
  "2013-06-01", "2013-06-02", "2013-06-03", "2013-06-04", "2013-06-05", 
  "2013-06-06", "2013-06-07", "2013-06-08", "2013-06-09", "2013-06-10", 
  "2013-06-11", "2013-06-12", "2013-06-13", "2013-06-14", "2013-06-16", 
  "2013-06-18", "2013-06-19", "2013-06-20", "2013-06-21", "2013-06-22", 
  "2013-06-23", "2013-06-25", "2013-06-26", "2013-06-27", "2013-06-28"
  ), class = "factor"), ano = c(1994L, 2001L, 2000L, 2004L, 2004L, 
  2004L), EDAD.1.PARTO = c(NA_integer_, NA_integer_, NA_integer_, 
  NA_integer_, NA_integer_, NA_integer_), SEXO.CRIA = structure(c(1L, 
  1L, 1L, 1L, 1L, 4L), .Label = c("", "--", " -H", " -M", " H", 
  " M", "H", "HH", "HM", "M", "MH", "MM", "XX"), class = "factor"), 
  TIPO = structure(c(1L, 1L, 1L, 1L, 1L, 2L), .Label = c("", 
  " -N", " N", "IN", "N", "PA", "PR", "XX"), class = "factor"), 
  ESTADO = structure(c(1L, 1L, 1L, 1L, 1L, 4L), .Label = c("", 
  "-", "M", "V", "X"), class = "factor"), IPPC = c(15L, 15L, 
  39L, 0L, 35L, 35L), IPPS = c(67L, 68L, 87L, 0L, 35L, 35L), 
  S = c(3L, 2L, 6L, 0L, 7L, 7L), IPC = c(110L, 127L, 127L, 
  0L, 425L, 325L), LECHE = c(21587L, 5937L, 10483L, 5576L, 
  7684L, 7684L), DIAS. = c(0L, 8L, 22L, 19L, 29L, 29L), lecheaj = c(NA, 
  226348L, 145333L, 89509L, 80814L, 80814L), X = c(NA_integer_, 
  NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_
  ), x = structure(c(1L, 1L, 1L, 254L, 1L, 1L), .Label = c("", 
  "1992-12-31", "1993-01-11", "1993-01-12", "1993-04-23", "1993-12-02", 
  "1994-02-11", "1994-02-12", "1994-04-27", "1994-05-15", "1994-10-18", 
  "1994-11-15", "1994-12-20", "1995-05-07", "1995-05-10", "1995-06-10", 
  "1995-06-19", "1995-08-07", "1995-08-15", "1995-09-30", "1995-10-06", 
  "2006-11-08", "2006-11-09", "2006-12-07", "2006-12-15", "2006-12-20", 
  "2007-01-02", "2007-01-05", "2007-02-15", "2007-02-28", "2007-03-12", 
  "aborto"), class = "factor"), xx = structure(c(1L, 1L, 1L, 
  9L, 1L, 1L), .Label = c("", " \\DA\\ ", " \\DE\\ ", " \\DP\\ ", 
  " \\DX\\ ", " \\MA\\ ", " \\MI\\ ", " \\ML\\ ", " \\MO\\ ", 
  " \\MP\\ ", " \\MS\\ ", " \\MT\\ ", " \\MX\\ "), class = "factor"), 
  nivelprod = structure(c(1L, 2L, 1L, 2L, 3L, 3L), .Label = c("ALTA", 
  "BAJA", "MEDIA"), class = "factor"), PM = structure(c(1L, 
  2L, 1L, 1L, 1L, 1L), .Label = c("multi", "primi"), class = "factor"), 
  EST = structure(c(3L, 4L, 4L, 4L, 4L, 4L), .Label = c("invierno", 
  "otono", "primavera", "verano"), class = "factor")), .Names = c("TAMBO", 
  "RP", "FECHA.NAC", "NP", "NP.AGRUPADO", "PARTO", "ano", "EDAD.1.PARTO", 
  "SEXO.CRIA", "TIPO", "ESTADO", "IPPC", "IPPS", "S", "IPC", "LECHE", 
  "DIAS.", "lecheaj", "X", "x", "xx", "nivelprod", "PM", "EST"), row.names =    c(NA, 
  6L), class = "data.frame")
  </code></pre>