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

2009-12-31 Thread Eduardo Leoni
In the meantime, try this. library(XML) theurl <- "http://www.aarresaari.net/jobboard/jobs.html"; download.file(theurl, "tmp.html") txt <- readLines("tmp.html") txt <- htmlTreeParse(txt, error=function(...){}, useInternalNodes = TRUE) g <- xpathSApply(txt, "//p", function(x) xmlValue(x)) head(grep

Re: [R] R Memory Usage Concerns

2009-09-14 Thread Eduardo Leoni
And, by the way, factors take up _more_ memory than character vectors. > object.size(sample(c("a","b"), 1000, replace=TRUE)) 4088 bytes > object.size(factor(sample(c("a","b"), 1000, replace=TRUE))) 4296 bytes On Mon, Sep 14, 2009 at 11:35 PM, jim holtman wrote: > When you read your file into R,

Re: [R] Transpose a dataset

2009-08-18 Thread Eduardo Leoni
## if x is a matrix this should work library(reshape) x <- structure(c(36.41099, 73.60079, 171.94, 67.48221, 131.917, 85.17079, 0.4015699, 9.4656186, 9.201167, 11.7657645, 14.4986667, 17.3150434, 35.1, 50, 153.5, 40, 97, 57.3, 36.2, 67, 166.5, 60, 122, 70.9, 36.5, 73, 173, 68, 132, 83.1, 36.666

Re: [R] PDF Compression

2009-07-30 Thread Eduardo Leoni
PDF created by R is in vector format. If you really want smaller files you can try creating PNGs instead. With a high enough resolution (e.g. dpi=600) there won't be much difference in the printed version of your document. -eduardo On Thu, Jul 30, 2009 at 7:55 AM, Benno Pütz wrote: > Thanks for

Re: [R] agrep behavior

2009-06-24 Thread Eduardo Leoni
hing to do mit > encodings? > >> sessionInfo() > R version 2.8.1 Patched (2009-01-19 r47650) > i386-apple-darwin9.6.0 > > locale: > en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 > > attached base packages: > [1] stats     graphics  grDevices utils     datasets  

[R] agrep behavior

2009-06-24 Thread Eduardo Leoni
Dear list - I am a bit puzzled by the behavior of agrep: The following command finds a match: agrep("Staatssekretar im Bundeskanzleramt","Bundeskanzler",max.distance=.6) But if I _increase_ the maximum distance to .9 it fails: agrep("Staatssekretar im Bundeskanzleramt","Bundeskanzler",max.dist

Re: [R] Sweave and accents

2009-06-09 Thread Eduardo Leoni
1) Please send reproducible code. In this case possibly with a link to the Snw file. 2) Try setting the charset in LaTeX: \usepackage[utf8]{inputenc} On Tue, Jun 9, 2009 at 12:07 PM, Arnau Mir Torres wrote: > Hello. > > I want to write my notes in Sweave in my own language (spanish). But my

Re: [R] ridiculous behaviour printing to eps: labels all messed

2009-06-08 Thread Eduardo Leoni
Perhaps you should try http://www.rforge.net/pgfSweave/ On Mon, Jun 8, 2009 at 5:38 PM, maiya wrote: > > Wow! Thank you for that Ted, a wonderfully comprehensive explanation and > now > everything makes perfect sense!! > > Regarding your last point, I would love to hear other people's experienc