similar to: combineLimits and Dates

Displaying 20 results from an estimated 1000 matches similar to: "combineLimits and Dates"

2012 Jul 31
2
Error Installing Package with Dependency on "Matrix"
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 consisting only of a DESCRIPTION file that specifies the dependence on "Matrix", a NAMESPACE file, and an R directory, containing a single function, "square <- function(x) { return (x*x) }". When I try to
2012 Aug 07
2
Repeated Aggregation with data.table
I have been using ddply to do aggregation, and I frequently define a single aggregation function that I use to aggregate over different groups. For example, require(plyr) dat <- data.frame(x = sample(3, 100, replace=TRUE), y = sample(3, 100, replace = TRUE), z = rnorm(100)) f <- function(x) { data.frame(mean.z = mean(x$z), sd.z = sd(x$z)) } ddply(dat, "x", f) ddply(dat,
2012 Jul 30
2
Thinning Lattice Plot
Is there an easy way to "thin" a lattice plot? I often create plots from large data sets, and use the "pdf" command to save them to a file, but the resulting files can be huge, because every point in the underlying dataset is rendered in the plot, even though it isn't possible to see that much detail. For example: require(Hmisc) x <- rnorm(1e6)
2011 Feb 18
2
Scaling Lattice Graphics for tikzDevice
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, but to be scaled down to match the size of the plot. I have written the following code to apply a scaling factor to all the "cex" and "padding" entries in the trellis parameters, but there is still a large white space between the key
2010 Nov 17
1
Multiple Line Plots with xyplot
I'm trying to make multiple line plots, each with a different color, using the xyplot command. Specifically, I have an NxK matrix Y and an Nx1 matrix x. I would like the plot to contain a line for each (x, Y[,i]), i=1:K. I know something like xyplot(Y[,1] + Y[,2] + Y[,3] ~ x, type='l') will work, but if Y is large, this notation can get very awkward. Is there a way to do something
2011 May 06
1
Cumsum in Lattice Panel Function
I'm trying to create an xyplot with a "groups" argument where the y-variable is the cumsum of the values stored in the input data frame. I almost have it, but I can't get it to automatically adjust the y-axis scale. How do I get the y-axis to automatically scale as it would have if the cumsum values had been stored in the data frame? Here is the code I have so far:
2011 Mar 01
1
Lattice: useOuterStrips and axes
Consider the following: library(lattice) library(latticeExtra) temp <- expand.grid( subject = factor(paste('Subject', 1:3)), var = factor(paste('Variable', 1:3)), time = 1:10 ) temp$resp <- rnorm(nrow(temp), 10 * as.numeric(temp$var), 1) ylimits <- by(temp$resp, temp$var, function(x) range(pretty(x))) useOuterStrips(xyplot( resp ~ time
2011 May 31
1
splom Tick Location
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. - Elliot [[alternative HTML version deleted]]
2009 Apr 28
1
latticeExtra: useOuterStrips and axis.line$lwd
Hi, I'm working on some lattice wireframe figures that have two conditioning factors, and I want the strips labelled on the top and left of the entire plot, rather than above each individual panel. useOuterStrips() does this, but it draws internal axis lines, even after I explicitly set axis.line to 0. Is there a way to use useOuterStrips but without axis boxes? I've included a short
2010 Mar 31
1
strip.custom with strip on left for three conditioning variables
I want to use a strip.custom as with useOuterStrips for three conditioning variables. useOuterStrips restricts this to only two conditioning variables, and I cannot figure out how to write strip.custom properly to do this. library(lattice) mtcars$HP <- equal.count(mtcars$hp) #with two factors x2<-xyplot(mpg ~ disp | HP + factor(cyl), mtcars) useOuterStrips(x2) #with three factors
2009 Dec 04
1
Lattice : Help with changing the labels of x-axis in respective panels
Dear R-Helpers, I am not very experienced in using lattice and I am still in the learning stage I have a data set which looks like this: (I have deleted a few lines in order to save space) Chromosome marker Marker.Name Distance 1 1 1 PeMm261 0.0000 2 1 2 Xtxp8 10.1013 .. 20 1 20 EbMi148 210.3099 21 1 21 Xtxp25
2009 Apr 09
3
Multiple Hexbinplots in 2 columns with a Single Categorical Variable
Dear Ladies and Gentlemen, I have a fairly large database (N=13,000) and a single main categorical discriminator between the groups. I want to look at the time course of a number of continuous biochemical variables over chronologic age. Therefore I believe I need to prepare hexbinplots in two columns with simple regression lines in them (with useOuterStrips (in library(latticeExtra) if
2013 Sep 19
3
lattice: double y - problem changing axis color after doubleYScale
Hi, I have had some troubles using doubleYScale. No matter what I try, I cant manage to change the color of the y-axis in the end. I have to produce a black and white plot. There is also something I do not understand regarding fontfamilyj="serif" when using it in: strip=strip.custom() Maybe someone has a better idea for defining which line and dots belong to which y-axis when not using
2011 Jan 31
1
Generic Functions and Dates
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 any vector? setGeneric("nan2last", function(x) {
2012 Jun 25
0
"Tight" Axes in Prepanel Function
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 = NULL, ...) { if (is.null(groups)) { result <- list(ylim = range(y)) }
2011 Mar 26
1
bwplot [lattice]: how to get different y-axis scales for each row?
Dear expeRts, How can I get ... (1) different y-axis scales for each row (2) while having the same y-axis scales for different columns? I coulnd't manage to do this with relation="free" [which gives (1) but not (2)]. I also tried relation="sliced", but it did not give the same y-axis scales within each row (see the fourth row). Further, it "separates" the
2001 Feb 13
1
Which.min bug?
Hi, I'm not sure this is a bug, so I thought I'd bounce it off the help group first. I had a dataset which I was subsetting, and occasionally I get an empty subset. If I don't check for emptiness and go straight to a which.min call on the subset, the program gets a big negative number back. One-line Example: > which.max(NULL) [1] -2147483647 This caused an indexing
2011 May 12
1
Errors and line numbers in scripts?
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 out? *>* *>* I call my script like: *>* *>* $ R --vanilla < script.R >
2011 Mar 10
1
Lattice: Feature Request
Hi, I'm currently designing some global themes for use with lattice, and have hit a snag. There doesn't appear to be (in xyplot at least) a way of setting a lattice option for the 'scales' parameter at a global level - changes have to be made in each function call. For example, consider the following code: library(lattice) library(latticeExtra) # Create some data temp <-
2004 Jul 08
1
Bug in Make or configure: spaces in path (PR#7068)
>>>>> "williams" == williams elliot <williams.elliot@bls.gov> >>>>> on Thu, 8 Jul 2004 01:50:16 +0200 (CEST) writes: williams> Full_Name: Elliot Williams Version: 1.9.1 OS: williams> Linux Submission from: (NULL) (146.142.53.18) williams> Hi, williams> The usual configure/make procedure hangs when williams>