similar to: multiple plots in same graph window

Displaying 20 results from an estimated 8000 matches similar to: "multiple plots in same graph window"

2008 Jun 18
4
inverse cumsum
I've a matrix like this: 1985 1.38 1.27 1.84 2.10 0.59 3.47 1986 1.05 1.13 1.21 1.54 0.21 2.14 1987 1.33 1.21 1.77 1.44 0.27 2.85 1988 1.86 1.06 2.33 2.14 0.55 1.40 1989 2.10 0.65 2.74 2.43 1.19 1.45 1990 1.55 0.00 1.59 1.94 0.99 2.14 1991 0.92
2010 Oct 30
2
Using names function
Just starting on my journey to learn R and the book I am using is "Using R for Introductory Statistics" One of the problems (page 15, 1.10) goes as follows: The monthly sales fig for 2002 were (2700, 2600, 3050, . . ). Using diff() find the month with greatest increase from prev month. I created a msales var: msales = c(2700, 2600, 3050 . . ) I named them:
2007 Jun 19
1
plotting order of lines in xyplot panels while using conditioning variable and groups
I am using the following code: library(lattice) data<-read.csv("data.csv") attach(data) fig<-xyplot(S_t~month|event, key = list(text=list(lab=c("Time to first CV event - Data", "Survival post first CV event - Model", "Survival post first MIA/CA event - Data",
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:
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]
2009 Jul 01
1
running count in data.frame
Hi, I need to keep a running count of events that have happened in my data.frame. I found a document called usingR that had an example of doing this for random coin flips and I tried to modify it. It seems to sort of work in the beginning, but then it stops and I don't understand why. I'm trying to duplicate essentially the Excel capability of =SUM($A$1:$A(Row number)) The example
2020 Aug 23
2
sum() vs cumsum() implicit type coercion
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" "-0.0004" "-0.0036" "-0.001" "-0.0011"
2011 Nov 26
5
cumsum in 3d arrays
Hello! Is it posible to apply /cumsum()/ along the 3rd dimension of 3D array? Something like matrlab function - /cumsum (*A*,dim)/ which returns the cumulative sum of the elements along the dimension of *A* specified by scalar dim. Thanks in advance ?eljka -- View this message in context: http://r.789695.n4.nabble.com/cumsum-in-3d-arrays-tp4110470p4110470.html Sent from the R help mailing
2008 Sep 16
1
Car.proper C[] matrix
I am hoping someone can help translate some WinBUGS code into R code. I would like to use R to create the C[] matrix required for a car.proper model in WinBUGS, but I am having a difficult time negotiating the coding. The C matrix provides normalized weights for each pair of spatial areas. So the WinBUGS example is as follows: # of the weight matrix with elements Cij. The first J1 elements
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:
2016 Mar 30
2
Compute the Gini coefficient
Hello, I would like to build a Lorenz curve and calculate a Gini coefficient in order to find how much parasites does the top 20% most infected hosts support. Here is my data set: Number of parasites per host: parasites = c(0,1,2,3,4,5,6,7,8,9,10) Number of hosts associated with each number of parasites given above: hosts = c(18,20,28,19,16,10,3,1,0,0,0) To represent the Lorenz curve: I
2011 Dec 09
3
bug in sum() on integer vector
Hi, x <- c(rep(1800000003L, 10000000), -rep(1200000002L, 15000000)) This is correct: > sum(as.double(x)) [1] 0 This is not: > sum(x) [1] 4996000 Returning NA (with a warning) would also be acceptable for the latter. That would make it consistent with cumsum(x): > cumsum(x)[length(x)] [1] NA Warning message: Integer overflow in 'cumsum'; use
2009 Feb 17
2
cumsum vs. sum
I recently traced a bug of mine to the fact that cumsum(s)[length(s)] is not always exactly equal to sum(s). For example, x<-1/(12:14) sum(x) - cumsum(x)[3] => 2.8e-17 Floating-point addition is of course not exact, and in particular is not associative, so there are various possible reasons for this. Perhaps sum uses clever summing tricks to get more accurate results? In some
2005 May 30
2
trouble with cumsum?
Dear R users, I am using R version 2.0.1 (2004/11/15) on an i386-pc-mingw32 platform. I encounter the following problem while using cumsum: > a <- rep(0.01, 100) > b <- cumsum(a) > sum(a) == 1 [1] TRUE > b[100] == 1 [1] FALSE Am I missing something? Should cumsum have such an outcome? Thanks in advance for any clarifications any of you can offer. Regards, Makram Talih --
2009 Nov 21
2
how to ignore NA when using cumsum?
I would like to cumulatively sum rows in a matrix, in which each row has 1 NA value. The usual "na.rm=TRUE" does not seem to work with the command cumsum. Is there another way to ignore the NAs or do I need to figure out a different way to do this? Here's an example matrix of title "proportion": Ntrail Strail NFJD Baldy Onion Crane [1,]
2002 Dec 05
2
Problems with segments and multiple graphs
I would like to create a page of two graphs (2 rows by 1 col) and then draw vertical lines (segments?) on both graphs from the minimum values to the corresponding maximum value. So I have tried # > y <- rnorm(3000) > par(mfrow=c(2,1)) > plot(y,type="l") > plot(cumsum(y),type="l") > segments(1000,min(cumsum(y)),1000,max(cumsum(y))) > par(mfg=c(1,1)) >
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
2012 Nov 22
4
Using cumsum with 'group by' ?
Hi, First post here. Grateful for any help you can give. I have data which looks like this: id time x 1 12:01 5 1 12:02 14 1 12:03 6 1 12:04 3 2 12:01 98 2 12:02 23 2 12:03 1 2 12:04 4 3 12:01 5 3 12:02 65 3 12:03 23 3 12:04 23 But I want to add a column which is the cumulative sum of X, but only by id. I've used cumsum before, but not
2009 Nov 21
1
how to ignore NA when using cumsum WHILE retaining NAs?
I would like to cumulatively sum rows in a matrix, in which each row has 1 NA value, which I do NOT want to treat as 0s. The NAs are placeholders where there is actually no data, which is not the same as a 0. The usual "na.rm=TRUE" does not seem to work with the command cumsum. Is there another way to ignore the NAs or do I need to figure out a different way to do this? Here's an
2009 Apr 10
3
turning list into vector/dataframe
Hi, I have used this command : resamples<-lapply(1:1000,function(i) sample(lambs,replace=F)) resamples2<-lapply(resamples,Cusum) to get a list of 1000 samples of my data. The function Cumsum is defined as follows: Cusum<-function(x){ SUM<-cumsum(x)-(1:length(x))*mean(x) min<-min(cumsum(x)-(1:length(x))*mean(x)) max<-max(cumsum(x)-(1:length(x))*mean(x)) diff<-max-min