[R] Windows Installation Without Third-Party Packages

2015-04-09 Thread Elliot Joel Bernstein
I am trying to install R for Windows, but when I use the installer provided on CRAN, a number of third-party packages are installed by default (i.e. lattice, Matrix, codetools, etc.). If R is installed with administrator privileges, so it's available for all users, non-administrators can't update t

Re: [R] Repeated Aggregation with data.table

2012-09-21 Thread Elliot Joel Bernstein
ean(z)), by = eval(parse(text = sprintf("list(%s)", paste(x, collapse=","] I think that's a pretty ugly solution (although it does work), but I haven't come up with anything better. Any suggestions? Thanks. - Elliot On Tue, Sep 11, 2012 at 11:33 AM, El

Re: [R] Repeated Aggregation with data.table

2012-09-11 Thread Elliot Joel Bernstein
ssion( list(mean.z = mean(z), sd.z = sd(z)) ) > > dat[ , eval(flist), list(x)] >x mean.z sd.z > 1: 2 0.04436034 1.039615 > 2: 3 -0.06354504 1.077686 > 3: 1 -0.08879671 1.066916 > > -- > David. > > > A.K. >> >> >> >> - Original Mes

[R] Repeated Aggregation with data.table

2012-08-07 Thread Elliot Joel Bernstein
can reuse, similar to the function "f" above. Can someone please explain how to do that? Thanks. - Elliot -- Elliot Joel Bernstein, Ph.D. | Research Associate | FDO Partners, LLC 134 Mount Auburn Street | Cambridge, MA | 02138 Phone: (617) 503-4619 | Email: elliot.bernst...@fdopartner

Re: [R] Thinning Lattice Plot

2012-07-31 Thread Elliot Joel Bernstein
(), which is very much a traditional > graphics function. I should add that this is for Hmisc 3.9-2, and > don't know if the behaviour is different with other versions. > > Note that Ecdf() has more features than ecdfplot(), in particular it > allows weights. > > -Deepayan

Re: [R] Error Installing Package with Dependency on "Matrix"

2012-07-31 Thread Elliot Joel Bernstein
t On Tue, Jul 31, 2012 at 11:33 AM, Elliot Joel Bernstein < elliot.bernst...@fdopartners.com> wrote: > I'm attempting to update to R 2.15.1, and I'm having trouble with a > package that depends on the "Matrix" package. I've created a dummy package > consistin

[R] Error Installing Package with Dependency on "Matrix"

2012-07-31 Thread Elliot Joel Bernstein
failed for package ‘temp’ * removing ‘/home/ebernstein/Rlib_2.15.1/temp’ If I remove the dependency on "Matrix", it installs fine. I'm using R 2.15.1 on linux, and version 1.0-6 of the Matrix package. Can anyone explain what's going on here? Thanks. - Elliot -- Elliot Joel Bernste

Re: [R] Thinning Lattice Plot

2012-07-31 Thread Elliot Joel Bernstein
just call the "histogram" function with a different prepanel and panel function. Is it not considered a lattice plot only because it isn't part of the lattice package? Thanks. - Elliot On Tue, Jul 31, 2012 at 2:32 AM, Deepayan Sarkar wrote: > On Tue, Jul 31, 2012 at 2:43 AM, El

[R] Thinning Lattice Plot

2012-07-30 Thread Elliot Joel Bernstein
possible to see that much detail. For example: require(Hmisc) x <- rnorm(1e6) pdf("test.pdf") Ecdf(x) dev.off() The resulting pdf files is 31MB. Is there any easy way to get a smaller pdf file without having to manually prune the dataset? Thanks. - Elliot -- Elliot Joel Berns

[R] combineLimits and Dates

2012-06-25 Thread Elliot Joel Bernstein
d | g, groups = h, data = dat, type = 'l', scales = list(relation = "free"), auto.key = TRUE) plt1 <- useOuterStrips(plt1) plt1 <- combineLimits(plt1) The x-axis labels are right after the call to 'useOuterStrips' but they get converted to numeric after the call to '

[R] "Tight" Axes in Prepanel Function

2012-06-25 Thread Elliot Joel Bernstein
How do I specify a "tight" y-axis, where the plot completely fills the y-axis range, inside the prepanel function? For example, consider the following code: require(lattice) set.seed(12345) x <- 1:1000 y <- cumsum(rnorm(length(x))) prepanel.test <- function(x, y, groups = NULL, subscripts = NUL

[R] splom Tick Location

2011-05-31 Thread Elliot Joel Bernstein
When using the 'splom' function of the 'lattice' packge, is it possible to get all the tick marks in the outer margins of the plot? X <- as.data.frame(matrix(rnorm(1000), 100, 10)) plot(X) ## Tick marks are in the outer margin splom(X) ## Tick marks are inside the on-diagonal panels Thanks. - El

[R] Errors and line numbers in scripts?

2011-05-12 Thread Elliot Joel Bernstein
Is it possible to get R to report the line number of an error when a script is called with source()? I found the following post from 2009, but it's not clear to me if this ever made it into the release version: ws wrote: >* Is there a way to have R return the line number in a script when it errors

Re: [R] Cumsum in Lattice Panel Function

2011-05-11 Thread Elliot Joel Bernstein
That worked perfectly. Thanks! - Elliot On Mon, May 09, 2011 at 12:20:36AM +0530, Deepayan Sarkar wrote: > On Fri, May 6, 2011 at 9:24 PM, Elliot Joel Bernstein > wrote: > > I'm trying to create an xyplot with a "groups" argument where the y-variable > > is t

[R] Cumsum in Lattice Panel Function

2011-05-06 Thread Elliot Joel Bernstein
nt the result to look the same as if I had done dat$cumvalue <- with(dat, unsplit(lapply(split(value, group), cumsum), group)) xyplot(cumvalue ~ date, data = dat, group = group, type = 'l', grid = TRUE) Thanks for your help. - Elliot Elliot Joel

Re: [R] Scaling Lattice Graphics for tikzDevice

2011-02-19 Thread Elliot Joel Bernstein
On Feb 18, 2011 11:02 PM, "Deepayan Sarkar" wrote: > > On Fri, Feb 18, 2011 at 11:04 PM, Elliot Joel Bernstein > wrote: > > I'm trying to use lattice graphics to produce some small plots for inclusion in a LaTeX file. I want the LaTeX fonts to be used in the plots,

[R] Scaling Lattice Graphics for tikzDevice

2011-02-18 Thread Elliot Joel Bernstein
par.settings = rescale.pars()) dev.off()

[R] Generic Functions and Dates

2011-01-31 Thread Elliot Joel Bernstein
I'm trying to write a generic function that calls different methods depending on the structure of the argument, but not the exact type of its contents. For example, the function 'nan2last' below works for a numeric vector but not for a vector of Date objects. Is there any way to make it work on

[R] Aligning Grid Lines with Date Ticks in Trellis Plot

2010-11-24 Thread Elliot Joel Bernstein
I know this issue has been discussed before, but I hoped the advent of pretty.Date would resolve it. In the following code, the first plot produces misaligned vertical grid lines, while in the second plot they are properly aligned. Is there any way to get something along the lines of the first c

[R] Multiple Line Plots with xyplot

2010-11-17 Thread Elliot Joel Bernstein
;l') will work, but if Y is large, this notation can get very awkward. Is there a way to do something simpler, along the lines of xyplot(Y ~ x, type='l') Thanks. - Elliot -- Elliot Joel Bernstein, Ph.D. | Research Associate | FDO Partners, LLC 134 Mount Auburn Street | Cambridg