Le samedi 21 avril 2012 à 07:05 -0700, sagarnikam123 a écrit : > i want > "http://scop.berkeley.edu/astral/pdbstyle/?id=d1fjgc2&output=html",showing > information in webpage to be written in .txt file as it is(i don't want any > html tag) > i am using "RCurl" package > > >marathi<-htmlTreeParse("http://scop.berkeley.edu/astral/pdbstyle/?id=d1fjgc2&output=html") > >marathi > >kasam<-marathi$children$html[["body"]][["pre"]][["text"]] > >kasam > > write(kasam,"papita.txt") > Error in cat(list(...), file, sep, fill, labels, append) : > argument 1 (type 'list') cannot be handled by 'cat > > i want to write kasam, as shown on console into .txt file kasam is a list, not a character string: > str(kasam) Named list() - attr(*, "class")= chr [1:5] "XMLTextNode" "XMLNode" "RXMLAbstractNode" "XMLAbstractNode" ...
You need to convert it to a character vector first: write(xmlValue(kasam), "papita.txt") Regards ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.