[R] ggplot2: scale_y_log10() with geom_histogram

2011-03-29 Thread Markus Loecher
Dear ggplot2 users, is there an easy/elegant way to suppress zero count bars in histograms with logarithmic y axis ? One (made up) example would be qplot(exp(rnorm(1000))) + geom_histogram(colour = cornsilk, fill = darkblue) + scale_x_sqrt() + scale_y_log10() Thanks! Markus

[R] barplot, different color for shading lines and bar

2011-02-19 Thread Markus Loecher
Dear all, might there be a modified barplot function out there which allows the user to specify a fill color for the bars and independent parameters for the overlaid shading lines ? Currently, when I specify density and col, the fill color for the bars is white. Thanks! Markus

[R] RWeka, java.lang.NullPointerException

2010-10-28 Thread Markus Loecher
Dear all, I have trained a J48 classifier in RWeka but when I try to predict on new data I get the following exceptions: fit - J48(...) yNew - predict(fit, x, type=probability); Error in .jcall(RWekaInterfaces, [D, distributionForInstances, .jcast(classifier, : java.lang.NullPointerException

[R] package gbm, predict.gbm with offset

2010-09-21 Thread Markus Loecher
Dear all, the help file for predict.gbm states that The predictions from gbm do not include the offset term. The user may add the value of the offset to the predicted value if desired. I am just not sure how exactly, especially for a Poisson model, where I believe the offset is multiplicative ?

[R] package gbm C++ code as separate module

2010-09-10 Thread Markus Loecher
Dear all, I would like to separate the gbm C++ code from any R dependencies, so that it could be compiled into a standalone module. I am wondering if anyone has already done this and could provide me with some pointers/help ? Thanks! Markus [[alternative HTML version deleted]]

[R] modifying axis labels in lattice panels

2010-09-10 Thread Markus Loecher
Dear all, I am struggling to modify the axis labels/ticks in a panel provided to xyplot. To begin with, I do not know the equivalent of the xaxt=n directive for panels that would set the stage for no default x axis being drawn. My goal is to draw ticks and custom formatted labels at certain hours

Re: [R] modifying axis labels in lattice panels

2010-09-10 Thread Markus Loecher
at 12:45 PM, Dennis Murphy djmu...@gmail.com wrote: Hi: On Fri, Sep 10, 2010 at 7:16 AM, Markus Loecher markus.loec...@gmail.comwrote: Dear all, I am struggling to modify the axis labels/ticks in a panel provided to xyplot. To begin with, I do not know the equivalent of the xaxt=n

[R] no predict function in lme4 ?

2010-03-23 Thread Markus Loecher
Dear mixed effects modelers, I seem unable to find a predict method for mer objects in the package lme4. Am I not seeing the forest for the trees ? Any pointer would be very helpful. Thanks, Markus [[alternative HTML version deleted]] __

[R] expression(), mixed symbols and evaluated objects

2010-03-10 Thread Markus Loecher
Is it possible to mix symbols and evaluated objects inside the expression() function ? The following example shows what I am trying to achieve: for (m in 1:3) { plot(1:10); #just a place holder for the real plots title(expression(y = m * lambda)); } I want to actually evaluate the

Re: [R] MASS package not on CRAN ?

2010-03-09 Thread Markus Loecher
In fact, I must have a broken installation of R then (though I have not noticed any other problems so far). The library MASS is neither pre-installed nor can I explicitly install it (though the internet connection is up and functional). Thanks for all the help ! Markus 2010/3/9 Uwe Ligges

[R] R package pdf files

2010-03-09 Thread Markus Loecher
Dear all, the examples in the pdf files that are automatically built from the examples in package help files are poorly formatted; they frequently do not wrap to the next line and are cut off. While there is an easy work around by looking at the examples in the corresponding help files, I do

[R] MASS package not on CRAN ?

2010-03-09 Thread Markus Loecher
The MASS package is listed on the CRAN web site ( http://cran.r-project.org/web/packages/MASS/index.html) but I am unable to install it via install.packages(). The error is that the package is unavailable. When I manually download the source tar ball and try to install it on a Linux machine,

[R] grid.image(), pckg grid

2010-01-28 Thread Markus Loecher
While I am very happy with and awed by the grid package and its basic plotting primitives such as grid.points, grid.lines, etc, I was wondering whether the equivalent of a grid.image() function exists ? Any pointer would be helpful. Thanks ! Markus [[alternative HTML version deleted]]

[R] possible memory leak in predict.gbm(), package gbm ?

2009-10-30 Thread Markus Loecher
Dear gbm users, When running predict.gbm() on a large dataset (150,000 rows, 300 columns, 500 trees), I notice that the memory used by R grows beyond reasonable limits. My 14GB of RAM are often not sufficient. I am interpreting this as a memory leak since there should be no reason to expand memory

[R] package:snow, timeOut for makeSOCKcluster()

2009-10-01 Thread Markus Loecher
Dear snow users, is there any way to specify a max time after which makeSOCKcluster() stops trying to create socket connections and gives up/returns ? In my current setup (MAC OSX 10.5.8, R version 2.9) I have to force quit R if the host specified in makeSOCKcluster() either does not exist or does

[R] as.POSIXct(as.Date()) independent of timezone

2009-09-18 Thread Markus Loecher
Dear R users, I am struggling a bit with the converting dates to full POSIX timestamps, in particular, I would like to somehow force the timezone to be local, i.e. the output of as.POSIXct(as.Date(2008-07-01)) should always be equal to 2008-07-01 00:00:00, is that achievable ? I tried to set the

[R] read/write connections

2009-07-29 Thread Markus Loecher
Dear fellow R users, I would very much like to see an example of read/write connection (open = r+ ) for e.g. pipe() or any other R connection. I have a standalone program which accepts input from stdin, performs some processing and returns the results on stdout. Is it possible at all to open a

[R] read.table, row.names arg

2009-06-05 Thread Markus Loecher
Dear R users, I had somehow expected that read.table() would treat the column specified by the row.names argument as of class character. That seems to be the only sensible class allowed for a column containing row names. However, that does not seem to be the case, as the following example shows:

[R] quick square root axes

2009-05-05 Thread Markus Loecher
Dear R users, while I enjoy the built-in log argument to the plot() function, I wished it would be as easy to create more general custom transformed axes such as sqrt(), logit, etc... for example, instead of plot(x=exp(rnorm(10)), y=(1:10)^4, log = xy), sth. along the lines of

[R] can install.packages() copy utility files to the public_html directory ?

2009-05-04 Thread Markus Loecher
Dear fellow R-users, I am about to publish an HTML utility package to CRAN that expands on the R2HTML package and includes a few goodies such as sorted tables, easy automation of framed HTML reporting, etc. However, some of the resulting dynamic HTML pages need to access JavaScript code that

[R] source code for prompt()

2009-04-17 Thread Markus Loecher
Dear R community, pardon my ignorance but how would you get the source code fornon-visible functions ? For example, I would like to see and modify the source code for the prompt() function. Thanks! Markus [[alternative HTML version deleted]]

[R] package knnFinder, kd-trees

2009-02-19 Thread Markus Loecher
Dear R users, thanks to Samuel for making the package knnFinder available to the public. I was wondering if there is an easy way to only build and store the kdd tree in a first step and perform NN queries from then on ? It seems that nn() does both simultaneously. Thanks! Markus

[R] compressing data without writing output to file

2009-02-07 Thread Markus Loecher
This might seem like a strange question but is there any way to compress an R object (such as a matrix) and know its resulting size in bytes ? Clearly, I could implement this in the following way (if x is my matrix): zz - gzfile(fname,w); write.table(x,zz); close(zz);

[R] updating contents of a package

2009-02-07 Thread Markus Loecher
Dear fellow R users, I read through the Writing R Extensions document and am able to now create my own packages/libraries which so far are just well documented collections of my own R functions. I use package.skeleton() and the tools package to build these packages. However, it is not clear to me

[R] beanplot, Error in shapiro.test(x)

2009-02-06 Thread Markus Loecher
Dear all, I am trying to create beanplots from a dataset for which boxplot works fine. (MACOS, R 2.8.1 GUI 1.27 Tiger build 32-bit (5301)) I am getting the following error message: Error in shapiro.test(x) : sample size must be between 3 and 5000 I am not even sure why the shapiro.test is being

[R] interrupting R

2009-01-02 Thread Markus Loecher
Dear fellow R users, is there a generic way to gracefully interrupt an R function without terminating the entire session ? I am mainly interested in this answer for Linux and MacOS. I found neither Esc nor Ctrl-C to work; it seems that R does not check for signals periodically? Also, an entirely

Re: [R] interrupting R

2009-01-02 Thread Markus Loecher
not want to add more requests to his InBox. Thanks again, Markus On Fri, Jan 2, 2009 at 8:56 AM, Prof Brian Ripley rip...@stats.ox.ac.ukwrote: On Fri, 2 Jan 2009, Markus Loecher wrote: Dear fellow R users, is there a generic way to gracefully interrupt an R function without terminating

[R] apply() just loops ?

2008-11-12 Thread Markus Loecher
Dear R users, I have been diligently using the apply() family in order to avoid explicit for loops and speed up computation. However, when I finally inspected the source code for apply, it appears that the core computation is a simple loop as well. What am I missing ? Why the often found advice to

[R] findInterval(), binary search, log(N) complexity

2008-09-22 Thread Markus Loecher
Dear R users, the help for findInterval(x,vec) suggests a logarithmic dependence on N (=length(vec)), which would imply a binary search type algorithm. However, when I test this hypothesis, in the following manner: set.seed(-3645); l - vector(); N.seq - c(5000, 50, 100, 1000,

[R] gam negative.binomial

2008-05-16 Thread Markus Loecher
Dear list members, while I appreciate the possibility to deal with overdispersion for count data either by specifying the family argument to be quasipoisson() or negative.binomial(), it estimates just one overdispersion parameter for the entire data set. In my applications I often would like the

[R] mboost partial contribution plots

2008-05-05 Thread Markus Loecher
Just having read the nice review article on boosting in the latest Statistical Science, I would love to reproduce some of the plots inside that article, but it is not clear to me how to create the partial contribution plots for the Poisson regression. Does anyone have example code for this ? (The

[R] estimate of overdispersion with glm.nb

2008-04-21 Thread Markus Loecher
Dear R users, I am trying to fully understand the difference between estimating overdispersion with glm.nb() from MASS compared to glm(..., family = quasipoisson). It seems that (i) the coefficient estimates are different and also (ii) the summary() method for glm.nb suggests that overdispersion

[R] pnbinom.c qnorm.c

2008-04-17 Thread Markus Loecher
how to extract them. Thanking you ! Markus Loecher Princeton, NJ [[alternative HTML version deleted]] __ 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

[R] Confidence intervals for PCA scores/eigenvalues

2008-01-31 Thread Markus Loecher
Dear all, I have read various descriptions of employing resampling techniques, such as the bootstrap, to estimate the uncertainties of the eigenvectors computed by PCA. When I try __ R-help@r-project.org mailing list

[R] Too many open files

2007-12-27 Thread Markus Loecher
Dear all, Did this problem that was posted in 2006 (see below) ever got fully resolved ? I am encountering the exact same issue ; I have executed get.hist.quote() in a loop and now R not only refuses to establish any further connections to yahoo, but, worse, it will not open any files either. For