Displaying 20 results from an estimated 6000 matches similar to: "Cumsum in Lattice Panel Function"
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
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)
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,
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
2012 Jun 25
1
combineLimits and Dates
I'm having some trouble using the latticeExtra 'combineLimits' function
with a Date x-variable:
require(lattice)
set.seed(12345)
dates <- seq(as.Date("2011-01-01"), as.Date("2011-12-31"), "days")
dat <- data.frame(d = rep(dates, 4),
g = factor(rep(rep(c(1,2), each = length(dates)), 2)),
h =
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]]
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) {
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 >
2010 Jun 03
1
cumsum function with data frame
Dear list,
I have a problem with the cumsum function.
I have a data frame like the following one
variable Year value
EC01 2005 5
EC01 2006 10
AAO1 2005 2
AAO1 2006 4
what I would like to obtain is
variable Year value cumsum
EC01 2005 5 5
EC01
2002 Jul 24
4
cumsum and subsets of a data frame?
I have a question about using cumsum on subsets of a data frame.
Suppose I have a frame that looks something like this
> tmp
f x y
1 left 1 0
2 left 2 0
3 left 3 9
4 left 4 10
5 left 5 23
6 left 6 45
7 left 7 13
8 left 8 2
9 left 9 6
10 right 1 10
11 right 2 26
12 right 3 9
13 right 4 50
14 right 5 78
15 right 6 20
16 right 7 7
17 right 8 20
18 right 9 19
2009 Feb 26
1
Incorporating cumsum in for loop
Hello
Hello i have this DF:
> c
CHR_NR
diffdato1 x
1022 10395 1994-05-30 11.0 39 0 1994 1 1
0 0 24 1 1 24
29100 11377 2003-05-22 17.0 24 0 2003 1 1
0 0 15 1
2012 Feb 20
2
R
Hello, just a couple of short questions that would be much appreciated.
Is there a way of putting a vectors inputs in size order from low to high?
And if I had a random list or TRUE and FALSE, is there a way of finding the 100th TRUE?
Thank you very much,
Elliot Welch
elliot.welch at virgin.net
Sent from my BlackBerry? smartphone
2015 Dec 10
2
when RedHat makes patches for only some versions
> On Dec 10, 2015, at 10:40 AM, Leon Fauster <leonfauster at googlemail.com> wrote:
>
> Am 10.12.2015 um 16:16 schrieb Noam Bernstein <noam.bernstein at nrl.navy.mil>:
>> I guess this is really a RedHat, not CentOS question, but I?m hoping that someone here will be familiar enough with the upstream policy to have some useful information.
>>
>> How does
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
2015 Dec 10
2
when RedHat makes patches for only some versions
I guess this is really a RedHat, not CentOS question, but I?m hoping that someone here will be familiar enough with the upstream policy to have some useful information.
How does RedHat decide which versions to release patches for, e.g. https://access.redhat.com/security/cve/CVE-2015-7613 <https://access.redhat.com/security/cve/CVE-2015-7613> which has only a RH7 erratum, not 6? And are
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>
2020 Aug 25
1
sum() vs cumsum() implicit type coercion
>>>>> Tomas Kalibera
>>>>> on Tue, 25 Aug 2020 09:29:05 +0200 writes:
> On 8/23/20 5:02 PM, Rory Winston wrote:
>> Hi
>>
>> I noticed a small inconsistency when using sum() vs cumsum()
>>
>> I have a char-based series
>>
>> > tryjpy$long
>>
>> [1]
2020 Aug 25
0
sum() vs cumsum() implicit type coercion
On 8/23/20 5:02 PM, Rory Winston wrote:
> Hi
>
> I noticed a small inconsistency when using sum() vs cumsum()
>
> I have a char-based series
>
> > tryjpy$long
>
> [1] "0.0022" "-0.0002" "-0.0149" "-0.0023" "-0.0342" "-0.0245" "-0.0022"
>
> [8] "0.0003" "-0.0001"
2012 Feb 14
1
cumsum function to determine plankton phenology
Apologies for the empty email earlier!
I have species abundance data sampled at a weekly frequency or
sometimes monthly depending on the year.
The goal is to identify the dates in an annual cycle in which the
cumulative abundance of a species reaches some threshold.
Here's an example of the data for 1 species over an annual period:
"mc_pheno" is the object created from this data: