Re: [R] Assistance converting to R a python function that extracts from an XML file

2014-12-13 Thread Duncan Temple Lang
Hi Don library(XML) readxmldate = function(xmlfile) { doc = xmlParse(xmlfile) xpathSApply(doc, '//Esri/CreaDate | //Esri/CreaTime', xmlValue) } D. On 12/13/14, 12:36 PM, MacQueen, Don wrote: I would appreciate assistance doing in R what a colleague has done in python. Unfortunately

Re: [R] saveXML() prefix argument

2013-10-20 Thread Duncan Temple Lang
Thanks Earl and Milan. Yes, the C code to serialize does branch and do things differently for the different combinations of file, encoding and indent. I have updated the code to use a different routine in libxml2 for this case and that honors the indentation in this case. That will be in the next

Re: [R] saveXML() prefix argument

2013-10-18 Thread Duncan Temple Lang
Hi Earl Unfortunately, the code works for me, i.e. indents _and_ displays the accented vowels correctly. Can you send me the output of the function call libxmlVersion() and also sessionInfo(), please? D. On 10/18/13 10:27 AM, Earl Brown wrote: Thanks Duncan. However, now I can't get the

Re: [R] saveXML() prefix argument

2013-10-17 Thread Duncan Temple Lang
like the function XML:::saveXML.XMLInternalNode() does not use the 'prefix' parameter at all. So it won't be taken into account when calling saveXML() on objects of class XMLInternalNode. I think you should report this to Duncan Temple Lang, as this is probably an oversight. Regards

Re: [R] RCurl cookiejar

2013-08-27 Thread Duncan Temple Lang
Hi Earl The cookies will only be written to the file specified by the cookiejar option when the curl handle is garbage collected. If you use rm(ch) gc() the cookie.txt file should be created. This is the way libcurl behaves rather than something RCurl introduces. If you don't

Re: [R] XML package installation -- an old question

2013-08-15 Thread Duncan Temple Lang
Hi Tao In the same R session as you call install.packages(), what does system(which xml2-config, intern = TRUE) return? Basically, the error message from the configuration script for the XML package is complaining that it cannot find the executable xml2-config in your PATH. (You can also

Re: [R] How to download this data?

2013-08-03 Thread Duncan Temple Lang
=%s?expiryDates=specId=219;https://www.theice.com/productguide/ProductSpec.shtml;jsessionid=%s?expiryDates=specId=219; I really appreciate if someone help me to understand that. Thank you. - Original Message - From: Ron Michael ron_michae...@yahoo.com To: Duncan Temple Lang

Re: [R] How to download this data?

2013-08-02 Thread Duncan Temple Lang
That URL is an HTTPS (secure HTTP), not an HTTP. The XML parser cannot retrieve the file. Instead, use the RCurl package to get the file. However, it is more complicated than that. If you look at source of the HTML page in a browser, you'll see a jsessionid and that is a session identifier. The

Re: [R] xmlToDataFrame very slow

2013-07-31 Thread Duncan Temple Lang
Hi Stavros xmlToDataFrame() is very generic and so doesn't know anything about the particulars of the XML it is processing. If you know something about the structure of the XML, you should be able to leverage that for performance. xmlToDataFrame is also not optimized as it is just a convenience

Re: [R] downloading web content

2013-07-23 Thread Duncan Temple Lang
Hi Daisy Use getURLContent() rather than getURL(). The former handles binary content and this appears to be a zip file. You can write it to a file or read its contents directly in memory, e.g library(RCurl) z =

Re: [R] Weird 'xmlEventParse' encoding issue

2013-07-16 Thread Duncan Temple Lang
Hi Sascha Your code gives the correct results on my machine (OS X), either reading from the file directly or via readLines() and passing the text to xmlEventParse(). The problem might be the version of the XML package or your environment settings. And it is important to report the session

Re: [R] htmlParse (from XML library) working sporadically in the same code

2013-03-20 Thread Duncan Temple Lang
When readHTMLTable() or more generally the HTML/XML parser fails to retrieve a URL, I suggest you use check to see if a different approach will work. You can use the download.file() function or readLines(url()) or getURLContent() from the RCurl package to get the content of the URL. The you can

Re: [R] Create a Data Frame from an XML

2013-01-22 Thread Duncan Temple Lang
Hi Adam [You seem to have sent the same message twice to the mailing list.] There are various strategies/approaches to creating the data frame from the XML. Perhaps the approach that most closely follows your approach is xmlRoot(doc)[ row ] which returns a list of XML nodes whose node

Re: [R] Reading JSON files from R

2012-12-03 Thread Duncan Temple Lang
Hi m.dr. Reading data from MongoDB is no problem. So the RJSONIO or rjson packages should work. Can you send me the sample file that is causing the problem, please? The error about a method looks like a potential oversight in the combinations of inputs. Thanks D. On 12/3/12

Re: [R] reading json tables

2012-12-02 Thread Duncan Temple Lang
to be filled in with NAs before rbinding. Best, D. On 12/2/12 6:26 AM, Michael Friendly wrote: On 12/1/2012 4:08 PM, Duncan Temple Lang wrote: Hi Michael The problem is that the content of the .js file is not JSON, but actual JavaScript code. You could use something like the following

Re: [R] reading json tables

2012-12-01 Thread Duncan Temple Lang
Hi Michael The problem is that the content of the .js file is not JSON, but actual JavaScript code. You could use something like the following tt = readLines(http://mbostock.github.com/protovis/ex/wheat.js;) txt = c([, gsub(;, ,, gsub(var [a-zA-Z]+ = , , tt)), ]) tmp = paste(txt, collapse =

Re: [R] problem with XML package

2012-11-15 Thread Duncan Temple Lang
Hi Arvin 2.9.2 is very old. 2.13 is still old. Why not upgrade to 2.15.*? However, the problem is that you the object you are passing to xmlName() is NULL. This will give an error in the latest version of the XML package and most likely any version of the XML package. I imagine the

Re: [R] RCurl - curlPerform - Time out?!?

2012-10-30 Thread Duncan Temple Lang
Hi Florian Yes, there are several options for a curl operation that control the timeout. The timeout option is the top-level general one. There is also timeout.ms. You can also control the timeout length for different parts of the operation/request such as via the connecttimeout for just

Re: [R] XML namespace control

2012-10-29 Thread Duncan Temple Lang
Hi Ben Can you tell us the slightly bigger picture, please? Do you want to create a single similar node entirely in isolation or do you want to create it as part of an XML tree/document? Who will be reading the resulting XML. You can use a parent node top = newXMLNode(storms,

Re: [R] Parsing very large xml datafiles with SAX: How to profile anonymous functions?

2012-10-26 Thread Duncan Temple Lang
Hi Frederic Perhaps the simplest way to profile the individual functions in your handlers is to write the individual handlers as regular named functions, i.e. assigned to a variable in your work space (or function body) and then two write the handler functions as wrapper functions that call

Re: [R] Downloading a html table

2012-10-23 Thread Duncan Temple Lang
Rather than requiring manual tweaking, library(XML) readHTMLTable(http://www.worldatlas.com/aatlas/populations/usapoptable.htm;) will do the job for us. D. On 10/22/12 8:17 PM, David Arnold wrote: All, A friend of mine would like to use this data with his stats class:

Re: [R] Extracting results from Google Search

2012-10-23 Thread Duncan Temple Lang
Hi Eduardo Scraping the coordinates from the HTML page can be a little tricky in this case. Also, Google may not want you using their search engine for that. Instead, you might use their Geocoding API (https://developers.google.com/maps/documentation/geocoding), but do ensure that this fits

Re: [R] saving to docx

2012-10-20 Thread Duncan Temple Lang
Just to let people know On the Omegahat site (and source on github), there are packages for working with Office Open documents (and LibreOffice too), includinging RWordXML, RExcelXML and the generic package OOXML on which they rely. These are prototypes in the sense that they do not

Re: [R] Problems with getURL (RCurl) to obtain list files of an ftp directory

2012-10-12 Thread Duncan Temple Lang
Hi Francisco The code gives me the correct results, and it works for you on a Windows machine. So while it could be different versions of software (e.g. libcurl, RCurl, etc.), the presence of the word squid in the HTML suggests to me that your machine/network is using the proxy/caching

Re: [R] scraping with session cookies

2012-09-19 Thread Duncan Temple Lang
Hi ? The key is that you want to use the same curl handle for both the postForm() and for getting the data document. site = u = http://www.wateroffice.ec.gc.ca/graph/graph_e.html?mode=textstn=05ND012prm1=3syr=2012smo=09sday=15eyr=2012emo=09eday=18; library(RCurl) curl = getCurlHandle(cookiefile

Re: [R] scraping with session cookies

2012-09-19 Thread Duncan Temple Lang
been trying what you suggested however I am getting an error when trying to create the function fun- createFunction(forms[[1]]) it says Error in isHidden I hasDefault : operations are possible only for numeric, logical or complex types On Wed, Sep 19, 2012 at 12:15 AM, Duncan Temple Lang

Re: [R] memory leak using XML readHTMLTable

2012-09-17 Thread Duncan Temple Lang
Hi James Unfortunately, I am not certain if the latest version of the XML package has the garbage collection activated for the nodes. It is quite complicated and that feature was turned off in some versions of the package. I suggest that you install the version of the package on github

Re: [R] memory leak using XML readHTMLTable

2012-09-17 Thread Duncan Temple Lang
Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Mon, Sep 17, 2012 at 11:16 AM, Duncan Temple Lang dun...@wald.ucdavis.edu wrote: Hi James Unfortunately, I am not certain if the latest version of the XML package has

Re: [R] Parsing large XML documents in R - how to optimize the speed?

2012-08-11 Thread Duncan Temple Lang
Hi Frederic You definitely want to be using xmlParse() (or equivalently xmlTreeParse( , useInternalNodes = TRUE)). This then allows use of getNodeSet() I would suggest you use Rprof() to find out where the bottlenecks arise, e.g. in the XML functions or in S4 code, or in your code

Re: [R] readHTMLTable function - unable to find an inherited method ~ for signature NULL

2012-06-14 Thread Duncan Temple Lang
The second page (mmo-champion.com) doesn't contain a table node. To scrape the data from the page, you will have to explore its HTML structure. D. On 6/14/12 9:31 AM, Moon Eunyoung wrote: Hi R experts, I have been playing with library(XML) recently and found out that readHTMLTable

Re: [R] How to set cookies in RCurl

2012-06-07 Thread Duncan Temple Lang
To just enable cookies and their management, use the cookiefile option, e.g. txt = getURLContent(url, cookiefile = ) Then you can pass this to readHTMLTable(), best done as content = readHTMLTable(htmlParse(txt, asText = TRUE)) The function readHTMLTable() doesn't use RCurl and doesn't

Re: [R] How to set cookies in RCurl

2012-06-07 Thread Duncan Temple Lang
Apologies for following up on my own mail, but I forgot to explicitly mention that you will need to specify the appropriate proxy information in the call to getURLContent(). D. On 6/7/12 8:31 AM, Duncan Temple Lang wrote: To just enable cookies and their management, use the cookiefile option

Re: [R] using XML package to read RSS

2012-05-16 Thread Duncan Temple Lang
Hi James. Yes, you need to identify the namespace in the query, e.g. getNodeSet(doc, //x:entry, c(x = http://www.w3.org/2005/Atom;)) This yeilds 40 matching nodes. (getNodeSet() is more convenient to use when you don't specify a function to apply to the nodes. Also, you don't need

Re: [R] Scraping a web page.

2012-05-15 Thread Duncan Temple Lang
Hi Keith Of course, it doesn't necessarily matter how you get the job done if it actually works correctly. But for a general approach, it is useful to use general tools and can lead to more correct, more robust, and more maintainable code. Since htmlParse() in the XML package can both

Re: [R] how to download data from soap server using R

2012-05-06 Thread Duncan Temple Lang
There is a kegg package available from the BioConductor repository. Also, you can generate an interface via the SSOAP package: library(SSOAP) w = processWSDL(http://soap.genome.jp/KEGG.wsdl) iface = genSOAPClientInterface(, ) iface@functions$list_datbases() D. On 5/6/12 3:01 AM,

Re: [R] readHTLMTable help

2012-03-27 Thread Duncan Temple Lang
Hi Lucas The HTML page is formatted by using tables in each of the cells of the top-most table. As a result, the simple table is much more complex. readHTMLTable() is intended for quick and easy tables. For tables such as this, you have to implement more customized processors. doc =

Re: [R] SSOAP and Chemspider: Security token?

2012-03-07 Thread Duncan Temple Lang
Hi Michael Thanks for the report and digging into the actual XML documents that are sent. It turns out that if I remove the redundant namespace definitions and just use a single one on the SimpleSearch node, all is apparently fine. I've put a pre-release version of the SSOAP package that does

Re: [R] RCurl format

2012-01-30 Thread Duncan Temple Lang
Hi KTD Services (!) I assume by DELETE, you mean the HTTP method and not the value of a parameter named _method that is processed by the URL script. If that is the case, then you want to use the customRequest option for the libcurl operation and you don't need or want to use postForm().

Re: [R] Getting htmlParse to work with Hebrew? (on windows)

2012-01-30 Thread Duncan Temple Lang
With some off-line interaction and testing by Tal, the latest version of the XML package (3.9-4) should resolve these issues. So the encoding from the document is used in more cases as the default. It is often important to specify the encoding for HTML files in the call to htmlParse() and use

Re: [R] Custom XML Readers

2011-12-25 Thread Duncan Temple Lang
In addition to the general tools of the XML package, I also had code that read documents with a similar structure to the ones Andy illustrated. I put them and simple examples of using them at the bottom of http://www.omegahat.org/RSXML/ page. D. On 12/23/11 5:50 PM, Ben Tupper wrote: Hi

Re: [R] Text Mining with Facebook Reviews (XML and FQL)

2011-10-11 Thread Duncan Temple Lang
Hi Kenneth First off, you probably don't need to use xmlParseDoc(), but rather xmlParse(). (Both are fine, but xmlParseDoc() allows you to control many of the options in the libxml2 parser, which you don't need here.) xmlParse() has some capabilities to fetch the content of URLs.

Re: [R] Add png image outside plot borders

2011-09-18 Thread Duncan Temple Lang
Amelia You can persuade rasterImage() (and other functions) to draw outside of the data region using xpd = NA or xpd = TRUE. See the help for the par function. D. On 9/18/11 1:59 PM, Amelia McNamara wrote: If you run this, you'll see that I have some text at the bottom, but the logo is

Re: [R] htmlParse hangs or crashes

2011-09-06 Thread Duncan Temple Lang
Hi Simon Unfortunately, it works for me on my OS X machine. So I can't reproduce the problem. I'd be curious to know which version of libxml2 you are using. That might be the cause of the problem. You can find this with library(XML) libxmlVersion() You might install a more recent

Re: [R] R hangs after htmlTreeParse

2011-08-25 Thread Duncan Temple Lang
Hi Simon I tried this on OS X, Linux and Windows and it works without any problem. So there must be some strange interaction with your configuration. So below are some things to try in order to get more information about the problem. It would be more informative to give us the explicit

Re: [R] convert an xml object into a list on R 2.13

2011-08-16 Thread Duncan Temple Lang
Hi Samuel The xmlToList() function is still in the XML package. I suspect you are making some simple mistake like not loading the XML package or haven't installed it or are not capitalizing the name of the function correctly (you refer the xml package rather than by its actual name). You

Re: [R] Reading XML files masquerading as XL files

2011-08-10 Thread Duncan Temple Lang
Hi Dennis That those files are in a directory/folder suggests that they were extracted from their zip (.xlsx) file. The following are the basic contents of the .xlsx file 1484 02-28-11 12:48 [Content_Types].xml 733 02-28-11 12:48 _rels/.rels 972 02-28-11 12:48

Re: [R] SSOAP chemspider

2011-08-08 Thread Duncan Temple Lang
Hi Paul I've been gradually filling in the XMLSchema packages for different cases that arise. My development versions of SSOAP and XMLSchema get a long way further and I have been trying to find time to finish them off. Fortunately, it is on my todo list for the next few weeks. I have

Re: [R] reading data from password protected url

2011-06-25 Thread Duncan Temple Lang
Hi Steve RCurl can help you when you need to have more control over Web requests. The details vary from Web site to Web site and the different ways to specify passwords, etc. If the JSESSIONID and NCES_JSESSIONID are regular cookies and returned in the first request as cookies, then you can

Re: [R] read.csv fails to read a CSV file from google docs

2011-04-29 Thread Duncan Temple Lang
Thanks David for fixing the early issues. The reason for the failure is that the response from the Web server is a to redirect the requester to another page, specifically

Re: [R] read.csv fails to read a CSV file from google docs

2011-04-29 Thread Duncan Temple Lang
://www.biostatistics.co.il (Hebrew) | www.r-statistics.com http://www.r-statistics.com (English) -- On Fri, Apr 29, 2011 at 9:18 PM, Duncan Temple Lang dun...@wald.ucdavis.edu mailto:dun...@wald.ucdavis.edu wrote

Re: [R] RCurl and postForm()

2011-04-29 Thread Duncan Temple Lang
Hi Ryan postForm() is using a different style (or specifically Content-Type) of submitting the form than the curl -d command. Switching the style = 'POST' uses the same type, but at a quick guess, the parameter name 'a' is causing confusion and the result is the empty JSON array - []. A

Re: [R] Treatment of xml-stylesheet processing instructions in XML module

2011-04-06 Thread Duncan Temple Lang
Hi Adam To use XPath and getNodeSet on an XML document, you will want to use xmlParse() and not xmlTreeParse() to parse the XML content. So t = xmlParse(I(a)) # or asText = TRUE elem = getNodeSet(t, /rss/channel/item)[[1]] works fine. You don't need to specify the root node, but rather the

Re: [R] Package XML: Parse Garmin *.tcx file problems

2011-03-30 Thread Duncan Temple Lang
Hi Michael Almost certainly, the problem is that the document has a default namespace. You need to identify the namespace in the XPath query. xpathApply() endeavors to make this simple: xpathApply(doc2, //x:TotalTimeSeconds, xmlValue, namespaces = x) I suspect that will give you back

Re: [R] Scrap java scripts and styles from an html document

2011-03-29 Thread Duncan Temple Lang
On 3/28/11 11:38 PM, antujsrv wrote: Hi, I am working on developing a web crawler in R and I needed some help with regard to removal of javascripts and style sheets from the html document of a web page. i tried using the xml package, hence the function xpathApply library(XML) txt =

Re: [R] RCurl HTTP Post ?

2011-02-19 Thread Duncan Temple Lang
On 2/17/11 3:54 PM, Hasan Diwan wrote: According to [1] and [2], using RCurl to post a form with basic authentication is done using the postForm method. I'm trying to post generated interpolation data from R onto an HTTP form. The call I'm using is page -

Re: [R] Using open calais in R

2011-01-25 Thread Duncan Temple Lang
://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. -- There are men who can think no deeper than a fact - Voltaire Duncan Temple Langdun

Re: [R] Accessing data via url

2011-01-08 Thread Duncan Temple Lang
Just for the record, you don't need to manually find the URL to which your are being redirected by using the followlocation option in any of the RCurl functions: tt = getURLContent(https://sites.google.com/site/jrkrideau/home/general-stores/duplicates.csv;, followlocation

Re: [R] toJSON question

2010-12-11 Thread Duncan Temple Lang
On 12/11/10 8:00 AM, Santosh Srinivas wrote: Hello, I am trying to use RJSONIO I have: x - c(0,4,8,9) y - c(3,8,5,13) z - cbind(x,y) Any idea how to convert z into the JSON format below? I want to get the following JSON output to put into a php file. [[0, 3], [4, 8], [8, 5],

Re: [R] Is there an implementation for URL Encoding (/format) in R?

2010-11-25 Thread Duncan Temple Lang
On 11/25/10 7:53 AM, Tal Galili wrote: Hello all, I would like some R function that can translate a string to a URL encoding (see here: http://www.w3schools.com/tags/ref_urlencode.asp) Is it implemented? (I wasn't able to find any reference to it) I expect there are several

Re: [R] RCurl and cookies in POST requests

2010-11-21 Thread Duncan Temple Lang
you. chr Duncan Temple Lang (Monday 15 November 2010, 01:02): Hi Christian Thanks for finding this. The problem seems to be that the finalizer on the curl handle seems to disappear and so is not being called when the handle is garbage collected. So there is a bug somewhere and I'll

Re: [R] RCurl and cookies in POST requests

2010-11-14 Thread Duncan Temple Lang
Hi Christian Thanks for finding this. The problem seems to be that the finalizer on the curl handle seems to disappear and so is not being called when the handle is garbage collected. So there is a bug somewhere and I'll try to hunt it down quickly. In the meantime, you can achieve the same

Re: [R] RGoogleDocs stopped working

2010-11-10 Thread Duncan Temple Lang
Hi Harlan I just tried to connect to Google Docs and I had ostensibly the same problem. However, the password was actually different from what I had specified. After resetting it with GoogleDocs, the getGoogleDocsConnection() worked fine. So I don't doubt that the login and password are

Re: [R] postForm() in RCurl and library RHTMLForms

2010-11-05 Thread Duncan Temple Lang
-2010, IndexType = SP CNX NIFTY, check = new, style = POST ) On Fri, Nov 5, 2010 at 6:43 AM, Duncan Temple Lang dun...@wald.ucdavis.eduwrote: On 11/4/10 2:39 AM, sayan dasgupta wrote: Hi RUsers, Suppose I want to see the data on the website url - http

Re: [R] RBloomberg on R-2.12.0

2010-11-05 Thread Duncan Temple Lang
On 11/5/10 5:20 AM, Tolga I Uzuner wrote: Dear R Users, Tried to install RBloomberg with R-2.12.0 and appears RDComclient has not been built for this version of R, so failed. I then tried to get RBloombergs' Java API version to work, but ran into problems with RJava which does not

Re: [R] postForm() in RCurl and library RHTMLForms

2010-11-04 Thread Duncan Temple Lang
On 11/4/10 2:39 AM, sayan dasgupta wrote: Hi RUsers, Suppose I want to see the data on the website url - http://www.nseindia.com/content/indices/ind_histvalues.htm; for the index SP CNX NIFTY for dates FromDate=01-11-2010,ToDate=02-11-2010 then read the html table from the page using

Re: [R] File Downloading Problem

2010-11-01 Thread Duncan Temple Lang
I got this working almost immediately with RCurl although with that one has to specify any value for the useragent option, or the same error occurs. The issue is that R does not add an Accept entry to the HTTP request header. It should add something like Accept: *.* Using RCurl, u =

Re: [R] XML getNodeSet syntax for PUBMED XML export

2010-09-08 Thread Duncan Temple Lang
Hi Rob doc = xmlParse(url for document) dn = getNodeSet(doc, //descriptorna...@majortopic = 'Y']) will do what you want, I believe. XPath - a language for expressing such queries - is quite simple and based on a few simple primitive concepts from which one can create complex compound

Re: [R] R program google search

2010-09-04 Thread Duncan Temple Lang
Hi there One way to use Google's search service from R is libary(RCurl) library(RJSONIO) # or library(rjson) val = getForm(http://ajax.googleapis.com/ajax/services/search/web;, q = Google search AJAX , v = 1.0) results = fromJSONIO(val) Google requests that you provide your GoogleAPI key

Re: [R] getNodeSet - what am I doing wrong?

2010-08-31 Thread Duncan Temple Lang
(classes, fdef, mtable) : unable to find an inherited method for function saveXML, for signature XMLDocument ? Thanks, Joh Duncan Temple Lang wrote: Hi Johannes This is a common issue. The document has a default XML namespace, e.g. the root node is defined

Re: [R] getNodeSet - what am I doing wrong?

2010-08-30 Thread Duncan Temple Lang
Hi Johannes This is a common issue. The document has a default XML namespace, e.g. the root node is defined as unimod xmlns=http://www.unimod.org/xmlns/schema/unimod_tables_1;... . So you need to specify which namespace to match in the XPath expression in getNodeSet(). The XML

Re: [R] Parsing a XML file

2010-08-24 Thread Duncan Temple Lang
xmlDoc() is not the function to use to parse a file. Use doc = xmlParse(Malaria_Grave.xml) xmlDoc() is for programmatically creating a new XML within R. It could be more robust to being called with a string, but the key thing here is that it is not the appropriate function for what you

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday - CAN PAY FOR FIX

2010-07-21 Thread Duncan Temple Lang
Hi Harlan Can you send some code so that we can reproduce the problem. That will enable me to fix the problem quicker. D. On 7/21/10 8:26 AM, Harlan Harris wrote: I unfortunately haven't received any responses about this problem. We (the company I work for) are willing to discuss payment

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday - CAN PAY FOR FIX

2010-07-21 Thread Duncan Temple Lang
Hi Harlan If you install the latest version of RCurl from source via install.packages(RCurl, repos = http://www.omegahat.org/R;) and that should solve the problem, assuming I have been reproducing the same problem you mentioned. You haven't mentioned what operating system your are on.

Re: [R] XML and RCurl: problem with encoding (htmlTreeParse)

2010-07-03 Thread Duncan Temple Lang
. -- There are men who can think no deeper than a fact - Voltaire Duncan Temple Langdun...@wald.ucdavis.edu Department of Statistics work: (530) 752-4782 4210 Mathematical Sciences Bldg. fax: (530) 752-7099 One Shields Ave. University of California at Davis Davis, CA 95616, USA

Re: [R] Do colClasses in readHTMLTable (XML Package) work?

2010-03-20 Thread Duncan Temple Lang
On 3/17/10 6:52 PM, Marshall Feldman wrote: Hi, I can't get the colClasses option to work in the readHTMLTable function of the XML package. Here's a code fragment: require(XML) doc - http://www.nber.org/cycles/cyclesmain.html; table - getNodeSet(htmlParse(doc),//table)

Re: [R] parse an HTML page with verbose error message (using XML)

2010-03-11 Thread Duncan Temple Lang
Hi Yihui It took me a moment to see the error message as the latest development version of the XML package suppresses/hides them by default for htmlParse(). You can provide your own function via the error parameter. If you just want to see more detailed error messages on the console you can

Re: [R] Making FTP operations with R

2010-03-08 Thread Duncan Temple Lang
R does provide support for basic FTP requests. Not for DELETE requests. And not for communication on the same connection. I think your best approach is to use the RCurl package (http://www.omegahat.org/RCurl). D. Orvalho Augusto wrote: Dears I need to make some very basic FTP operations

Re: [R] Working with combinations

2010-03-02 Thread Duncan Temple Lang
I think there are several packages that implement combinations and several that allow you to specify a function to be called when each vector of combinations is generated. I can't recall the names of all such packages, but the Combinations package on www.omegahat.org/Combinations is one. D.

Re: [R] help with EXPASY HTML form submission in RCurl package

2010-02-13 Thread Duncan Temple Lang
is correct. I parsed the expasy protscale source code to identify the variables but the form does not seem to go through. I can post the html body code if needed. Regards Sunando On Fri, Feb 12, 2010 at 3:54 PM, Duncan Temple Lang dun...@wald.ucdavis.edu mailto:dun...@wald.ucdavis.edu wrote

Re: [R] help with EXPASY HTML form submission in RCurl package

2010-02-12 Thread Duncan Temple Lang
Sunando Roy wrote: Hi, I am trying to submit a form to the EXPASY protscale server ( http://www.expasy.ch/tools/protscale.html). I am using the RCurl package and the postForm function available in it. I have extracted the variables for the form from the HTML source page. According to the

Re: [R] write.zip?

2010-02-10 Thread Duncan Temple Lang
Hi Spencer I just put a new source version (0.9-0) of the Rcompression package on the www.omegahat.org/R repository and it has a new function zip() that creates or appends to a zip file, allowing one to provide alternative names. I'll add support for writing content from memory (i.e. AsIs

Re: [R] convert R plots into annotated web-graphics

2010-02-09 Thread Duncan Temple Lang
Hi While there is different level of support for SVG in the different browsers, basic SVG (non-animation) does work on all of them (with a plugin for IE). In addition to the 2 SVG packages on CRAN, there is SVGAnnotation at www.omegahat.org/SVGAnnotation and that is quite a bit more powerful.

Re: [R] create zip archive in R

2010-02-04 Thread Duncan Temple Lang
Uwe Ligges wrote: On 04.02.2010 03:31, mkna005 mkna005 wrote: Hello all! I was wondering if it is possible to create a zip archive within R and add files to it? No. Well, the Rcompression package on the Omegahat package does have some facilities for it. It doesn't do it in memory,

Re: [R] RCurl : limit of downloaded Urls ?

2010-01-31 Thread Duncan Temple Lang
Alexis-Michel Mugabushaka wrote: Dear Rexperts, I am using R to query google. I believe that Google would much prefer that you use their API rather than their regular HTML form to make programmatica search queries. I am getting different results (in size) for manual queries and queries

Re: [R] SSOAP XML-RPC

2010-01-27 Thread Duncan Temple Lang
Hi Jan Is .XMLRPC(http://localhost:9000;, Cytoscape.test, .opts = list(verbose = TRUE)) the command you used? If not, what did you use? Can you debug the .XMLRPC function (e.g. with options(error = recover)) and see what the XML that was sent to the server, i.e. the cmd variable

Re: [R] Data import export zipped files from URLs

2010-01-19 Thread Duncan Temple Lang
Dieter Menne wrote: Velappan Periasamy wrote: I am not able to import zipped files from the following link. How to get thw same in to R?. mydata - read.csv(http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip;) As Brian Ripley noted in

Re: [R] xmlToDataFrame#Help!!!

2010-01-10 Thread Duncan Temple Lang
the StatconnDCOM connector and the rcom package are encouraging). -- There are men who can think no deeper than a fact - Voltaire Duncan Temple Langdun...@wald.ucdavis.edu Department of Statistics work: (530) 752-4782 4210 Mathematical Sciences Bldg. fax: (530) 752

Re: [R] XML and RCurl: problem with encoding (htmlTreeParse)

2009-12-31 Thread Duncan Temple Lang
Hi Lauri. I am in the process of making some changes to the encoding in the XML package. I'll take a look over the next few days. (Not certain precisely when.) D. Lauri Nikkinen wrote: Hi, I'm trying to get data from web page and modify it in R. I have a problem with encoding. I'm not

Re: [R] Have you used RGoogleDocs and RGoogleData?

2009-12-12 Thread Duncan Temple Lang
of a document, e.g. a spreadsheet or word processing document or generic document. The changes made the detection more robust or more consistent with any changes at Google. D. Farrel Buchinsky Google Voice Tel: (412) 567-7870 On Fri, Dec 11, 2009 at 19:07, Duncan Temple Lang dun

Re: [R] Have you used RGoogleDocs and RGoogleData?

2009-12-11 Thread Duncan Temple Lang
Hi Farrel I have taken a look at the problems using RGoogleDocs to read spreadsheets and was able to reproduce the problem I believe you were having. A few minor, but important, changes and I can read spreadsheets again and apparently still other types of documents. I have put an updated

Re: [R] Scraping a web page

2009-12-03 Thread Duncan Temple Lang
Hi Michael If you just want all of the text that is displayed in the HTML docment, then you might use an XPath expression to get all the text() nodes and get their value. An example is doc = htmlParse(http://www.omegahat.org/;) txt = xpathSApply(doc, //body//text(), xmlValue) The result

Re: [R] Reading from Google Docs

2009-11-28 Thread Duncan Temple Lang
. [Thanks for telling me. However I did it last time was worse than sticking daggers in my eyes. ] install.packages( RGoogleDocs, repos=http://www.omegahat.org/R;, type=source ) I now have Package: RGoogleDocs Version: 0.4-0 Title: Maintainer: Duncan Temple Lang dun

Re: [R] Build of XML package failed

2009-11-27 Thread Duncan Temple Lang
Hi Luis. You can change the two lines PROBLEM buf WARN; to the one line warning(buf); That should compile. If not, please show us the compilation command for DocParse.c, i.e. all the arguments to the compiler, just above the error messages. D. Luis Tito de Morais wrote: Hi list,

Re: [R] How to suppress errors generated by readHTMLTable?

2009-11-26 Thread Duncan Temple Lang
Just this morning, I made suppressing these parser messages the default behavior for htmlParse() and that will apply to readHTMLTable() also. Until I release that (along with another potentially non-backward compatible change regarding character encoding), you can use

Re: [R] XML package example code?

2009-11-25 Thread Duncan Temple Lang
Peng Yu wrote: On Wed, Nov 25, 2009 at 12:19 AM, cls59 ch...@sharpsteen.net wrote: Peng Yu wrote: I'm interested in parsing an html page. I should use XML, right? Could you somebody show me some example code? Is there a tutorial for this package? Did you try looking through the help

Re: [R] problem post request with RCurl

2009-11-18 Thread Duncan Temple Lang
Use curlPerform(url = 'http://pubchem.ncbi.nlm.nih.gov/pug/pug.cgi', postfields = q) That gives me: PCT-Data PCT-Data_output PCT-OutputData PCT-OutputData_status PCT-Status-Message PCT-Status-Message_status PCT-Status value=running/

Re: [R] XML: Reading transition matrices into R

2009-11-12 Thread Duncan Temple Lang
stefan.d...@gmail.com wrote: Hello, from a software I have the following output in xml (see below): It is a series of matrices, for each age one. I have 3 categories (might vary in the application), hence, 3x3 matrices where each element gives the probability of transition from i to j. I

Re: [R] XML: Reading transition matrices into R

2009-11-12 Thread Duncan Temple Lang
, .children = trans) saveXML(top, newTransition.xml) Best, Stefan On Thu, Nov 12, 2009 at 3:17 PM, Duncan Temple Lang dun...@wald.ucdavis.edu wrote: stefan.d...@gmail.com wrote: Hello, from a software I have the following output in xml (see below): It is a series of matrices

Re: [R] help with SSOAP (can't find working examples)

2009-11-03 Thread Duncan Temple Lang
Hi Steffen et al. The development version of SSOAP and XMLSchema I have on my machine does complete the processWSDL() call without errors. I have to finish off some tests before releasing these. It may take a few days before I have time to work on this, but hopefully soon. Thanks for the info.

Re: [R] Error installing RSPerl.

2009-10-29 Thread Duncan Temple Lang
Hi Grainne There is one likely cause. But before getting into the explanation, can you send me the output from when you installed the package, e.g. the output from R CMD INSTALL RSPerl and any configuration arguments you specified. You can send this to me off-list and we can summarize

  1   2   3   >