[R] Correcting and Adding to Data Frame

Rich Shepard rshepard at appl-ecosys.com
Fri Feb 1 18:41:37 CET 2013


   Running on Slackware here with R-2.15.2. There is a data frame I need to
edit to correct mis-spellings and to add a row. I used the edit() command
with emacs but could not find the mis-spelled strings nor figure out how to
add another row.

   The data frame is stored in
/usr/lib/R/library/bio.infer/data/itis.ttable.rda

and I load it after invoking the bio.infer library.

   Running the bio.infer get.taxonomic() function brings up a dialog box
asking me to correct 5 entries; four are mis-spellings that I correct. When
I close the dialog box the function returns a message that one taxon is not
in the table:

  bcnt <- get.taxonomic(emapben)
The following taxa are not in ITIS:
RADOTANYPUS

   Adding this taxon to the table seems to make no difference:

itis.ttable <- rbind(itis.ttable, data.frame(PHYLUM = "ARTHROPODA",
SUBPHYLUM = NA, SUPERCLASS = NA, CLASS = "INSECTA", SUBCLASS = NA,
INFRACLASS = NA, SUPERORDER = NA, ORDER = "DIPTERA", SUBORDER =
"NEMATOCERA", INFRAORDER = "CULICOMORPHA", SUPERFAMILY = "CHIRONOMOIDAE",
FAMILY = "CHIRONOMIDAE", SUBFAMILY = "TANYPODINAE", TRIBE = NA, SUBTRIBE =
NA, GENUS = "RADOTANYPUS", TAXON = NA))
> bcnt <- get.taxonomic(emapben)
The following taxa are not in ITIS:
RADOTANYPUS

   When I edit the names in the get.taxonomic() dialog box they seem to not
be corrected in the data frame as they also are displayed the second time.
And, using rbind() to add the missing row does not seem to take.

   What steps have I missed here, and how should I make these corrections and
the addition?

Rich



More information about the R-help mailing list