namesText<-c(
"1\t|\tall\t|\t\t|\tsynonym\t|",
"1\t|\troot\t|\t\t|\tscientific name\t|",
"3\t|\tMulti\t|\tBacteria \t|\tscientific name\t|",
"4\t|\tMulti\t|\tBacteria \t|\tscientific name\t|",
"2\t|\tBacteria\t|\tBacteria \t|\tscientific name\t|",
"2\t|\tMonera\t|\tMonera \t|\tin-part\t|",
"2\t|\tProcaryotae\t|\tProcaryotae \t|\tin-part\t|"
)
tmpFile<-tempfile()
writeLines(namesText,tmpFile)
names<-read.names(tmpFile)
getId2('Bacteria',names)
getId2('Not a real name',names)
getId2('Multi',names)
Run the code above in your browser using DataLab