Displaying 12 results from an estimated 12 matches for "useintern".
Did you mean:
useinternal
2008 Jun 17
2
try catch block
How can I use the try catch block such that if this statement fails
xml <- xmlTreeParse(xmlTxt, useInternal=TRUE)
then this statement is executed
xml <- xmlMalFormed()
?
This code does not work but assuming its somewhere along these lines:
tryCatch(xml <- xmlTreeParse(xmlTxt, useInternal=TRUE), xml <-
xmlMalFormed(f1))
--
View this message in context: http://www.nabble.com/try-catch-bl...
2008 Dec 31
1
Chinese characters encoding problem with XML
XML is a good tool reading data from web within R. But I wonder how could get the encoding correctly.
library(XML)
url <- 'http://www.szitic.com/docc/jz-lmzq.html'
xml <- htmlTreeParse(url, useInternal=TRUE)
q <- "//tbody/tr/td"
dat <- unlist(xpathApply(xml, q, xmlValue))
df <- as.data.frame(t(matrix(dat, 4)))
dt<-as.character(df[15,1])
The first column of df is dates in Chinese. dt is one of the Chinese dates.
When I copied the content of dt into the email, it become t...
2008 Oct 06
3
Extracting text from html code using the RCurl package.
Dear R-help,
I want to download the text from a web page, however what i end up
with is the html code. Is there some option that i am missing in the
RCurl package? Or is there another way to achieve this? This is the
code i am using:
> library(RCurl)
> my.url <- 'https://stat.ethz.ch/mailman/listinfo/r-help'
> html.file <- getURI(my.url, ssl.verifyhost = FALSE,
2012 Apr 26
0
Modifying values into XML with R
...is new playcount into the original XML.
Here is a reproducible example showing what I want to do:
######
### first download one of my xml from :
## https://www.dropbox.com/s/qxteao3z8ypyfqh/petitXMLwinamp.xml
## load it in R and root it:
winamp<-xmlTreeParse("petitXMLwinamp.xml", useInternal = T)
racine <- xmlRoot(winamp)
racine # to view the library
### I can extract one song (the first one for the example):
une.chanson <- xmlSApply(racine[[1]][["dict"]][[2]],xmlValue)
### I can extract the playcount of this track with:
racine[[1]][["dict"]][...
2008 Jun 12
1
XML parameters to Column Headers for importing into a dataset
Dear List,
Do you know any way I can convert XML parameters into column headers. My
data is in a csv file with each row containing a xml form of data , and
multiple parameters (
<param1> data_val1 </param2> , <param2> data_val2 </param2> )
I want to convert it so each row caters to one record and each parameter
becomes a different column.
param1
2008 May 02
1
How to parse XML
I would like to learn how to parse a mixed text/xml document I
downloaded from the sec.gov website (see example below). I would like
to parse this to get the value for each xml tag and then access it
within R, but I don't know much about xml so I don't even know where to
start debugging the errors I am getting in this example code. Can
anyone help me get started?
Thanks, Roger
ftp
2008 Jul 30
1
read XML
I have a xml exported by Manifold GIS but I'm not being able to import it
into R using XLM package.
The file have this structure:
<?xml version="1.0" encoding="UTF-8" ?>
- <layout>
<name>Layout 2</name>
<pagesByX>1</pagesByX>
<pagesByY>1</pagesByY>
- <elements>
<legend
2008 Jun 25
0
Memory allocation failed: Copying Node
...;, charStreamNew)
charStreamNew <- gsub("&", "and", charStreamNew)
xmlVec<-readLines(textConnection(charStreamNew))
xmlInDoc <- grep("</*XML", xmlVec)
xmlDoc <- xmlTreeParse(xmlVec[seq(xmlInDoc[1]+1, xmlInDoc[2]-1)],
useInternal=TRUE)
}
processTransaction <- function(rptOwner, nodes, outFile) {
transaction <- data.frame(
transdate=xValHelperSpecial(nodes,"transactionDate"),
securityTitle=xValHelperSpecial(nodes,&q...
2008 Jun 10
1
Parse XML
Could someone provide a link or examples of parsing XML document in R? Few
specific questions below:
For instance I can retrieve specific nodes using this:
node <- xpathApply(xml, "//" %+% xtag, xmlValue)
1) I want to be able to retrieve parent node for this node, how can I do
this? getParentNode() does not seem to cut it.
2) How can I retrieve children nodes for a particular
2008 Apr 12
1
Extracting a data.frame from HTML code
Dear all,
I'd like to use R to read in data from the web. I need some help finding an
efficient way to strip the HTML tags and reformat the data as a data.frame
to analyze in R.
I'm currently using readLines() to read in the HTML code and then grep() to
isolate the block of HTML code I want from each page, but this may not be
the best approach.
A short example:
x1 <- readLines("
2011 Jun 29
0
XML parsing
...rray>
</binaryDataArrayList>
</spectrum>
</spectrumList>
</run>
</mzML>
I want following Information:
from mzML/run/spectrumList the "count"-value.
I try this like this:
>root <- xmlTreeParse("Example_Continuous.imzML",useInternal = TRUE)
>spectrumList <-getNodeSet(root,"//spectrumList")
>sapply(spectrumList,xmlGetAttr,"count")
list()
Here I get List and no value, because the node spectrumList is empty.
Are there some methods for confortable navigating in the tree, like:
getChildrenByName.
Th...
2011 Jun 30
0
help with interpreting what nnet() output gives:
...rray>
</binaryDataArrayList>
</spectrum>
</spectrumList>
</run>
</mzML>
I want following Information:
from mzML/run/spectrumList the "count"-value.
I try this like this:
>root <- xmlTreeParse("Example_Continuous.imzML",useInternal = TRUE)
>spectrumList <-getNodeSet(root,"//spectrumList")
>sapply(spectrumList,xmlGetAttr,"count")
list()
Here I get List and no value, because the node spectrumList is empty.
Are there some methods for confortable navigating in the tree, like:
getChildrenByName.
Th...