similar to: cumulative sum in data frame

Displaying 20 results from an estimated 1500 matches similar to: "cumulative sum in data frame"

2009 Jun 19
1
Adding site id to xyplot
Dear R Lists, Can anyone help me add site IDs (site: 1~50) directly to my xyplot. I have 50 sites and collected observations from the sites at 13 different time points. I want to look at the change of my observations in each site. I was able to make a graph using xyplot, however, I can't find how to add site IDs within the graph not adding them in the legend. Overall, I would like to be able
2009 May 01
2
combine column names
Dear R-list, Is there any way I can extract part or whole column name from two variables and combine them? Not values, but column names. For example, I have data set with 70 variables. The column names are "Alfalfa", "Corn","Soybean",..."Sunflower". After I combine the two variable (say Alfalfa and Corn), I want to rename it as "AlfCor" or
2009 Mar 19
1
object size of a matrix and a list
Hello, My program calculates several variables at each iteration and some of them are integers and the rest are numeric. When I save them into a matrix, all of them are of numeric type, of course. I'm trying to find a way to save time/memory of my program and I was thinking that it might help to force some variables to be of integer type and the other columns numeric type. But when I
2009 Jun 29
2
Add ID numbers on a plot
Dear List, I have (for example) 50 observations collected from 50 experimental sites and want to look at changes of 50 observations as function of time in a graph. I found that I could do that using R-code below: time2 <- 1:25 y1=rnorm(25, mean=0, sd=1) y2=rnorm(25, mean=0, sd=1) ... y50=rnorm(25, mean=2, sd=1) plot(time2, y1, type='b', xlim=range(0,30), ylim=range(y1, y2),
2008 Mar 30
1
norm_rand() in R-extension vs rnorm in R ---which is better?
I need to generate good quality of random numbers from univariate normal distribution for further transformation. I tried rnorm in R but it was not good sometimes. Someone said C++ standard library or Fortran's built-in functions for that are good. I found that there is double norm_rand() in R-extension. Does this function, norm_rand() use the same algorithm as rnorm in R or something similar
2008 May 04
1
help with segmentation fault
Hello all, I'm trying to have C called by R. I wrote C codes that worked perfectly fine with R-2.6.0 in windows system ( using R tools). I had to change to SuSE Linux (this system has 3.2 GHz Intel Xeon processors and 4 GB of RAM), the C codes were compiled okay but when it was called to R-2.6.2, I got error mesage : ***caught segfault*** address 0x1df5000, cause 'memory not
2008 May 05
1
Is there any way to find out how a certain functions are implemented in R?
Hello I wrote a bootstrap program in C language that is called and run by R. When I tried it, it is slow and I'm trying to write and run the whole thing in C. But I cannot use handy functions in R and need to figure out how to write those functions by myself. Is there any way that I can get the actual codes that implement functions in R so that I can translate them into other languages? For
2008 Mar 05
1
Question on "assign(paste.."
Hello, I'm having trouble in using "assign(paste ..." command . I could create several dataframes following trinomial distribution using it but it could not be used to check their row means of the created dataframe. For example, the following works: probTrt=matrix(0,4,3); probTrt; #malf, death, normal probTrt[1,]=c(0.064,0.119,0.817);#for Trt 1 probTrt[2,]=c(0.053,0.125,0.823);#for
2008 Mar 07
1
parameters for lbfgsb (function for optimization)
Can anyone help me with lbfgsb (function for optimization)? It takes the following parameters: void lbfgsb (int n, int lmm, double *x, double *lower, double *upper, int *nbd, double *Fmin, optimfn fn, optimgr gr, int *fail, void *ex, double factr, double pgtol, int *fncount, int *grcount, int maxit, char *msg, int trace, int nREPORT); What do I put for parameter ex (11th parameter)? I looked at
2008 Apr 08
1
Using Rtools in Unix environment
The previous mail I wrote was bounced for some reason and I'm writing it again... I have used Rtools in windows to call C from R but my computer does not have enough memory for my current project. So I'm trying to use Rtools in the high performance computer at my school. The guy who handles the HPC says it's Unix and I have three questions: 1. I found from the web that Unix has
2008 Apr 11
2
system.time gives error when "=" is used for assignment (R-2.6.0)
Hello list, I found that system.time works correctly when I used "<-" to assign a value to a variable but when I happened to use "=" instead of "<-", R gave an error message: "Error in system.time(your argument here...)". It happened with a few functions I tried. Is this a bug or is there any circumstances that "=" cannot be used for
2008 Mar 08
1
Deleting rows satisfying a certain condition (sum of some colums>2)
I have a huge matrix and need to delete certain rows. What I need to do is: 1.In each row, calculate the sum of jth column and (J+2)th column 2. If the sum is greater than 2 then that row needs to be deleted. I have a sample matrix and my codes here. It does remove some rows but when it does, it skips the next row and each time it deletes a row, the dimension changes so it gets out of bound. I
2008 Apr 18
1
R-extension in unix system -- help to locate header files
Hi list, To call C, I used to use R-extension in windows but I'm moving to unix system because my PC doesn't have enough memory. My C codes requires to include the following header files: #include <stdlib.h> #include <R.h> #include <Rdefines.h> #include <Rmath.h> #include <R_ext/Applic.h> #include <R_ext/PrtUtil.h> In windows, I had no problem with it
2008 Nov 06
1
trouble with for loop
Hello, I'm having two similar problems with for loop and I would appreciate any help or comment. I want to use "for loop" to calculate series of initial values for an optimization problem. But some initial values have my function quit due to problems like calculating the inverse of singular matrices. I don't want to make my program check determinants and skip it if it is
2007 Jul 19
2
(R) Using arguments for the empirical cumulative distribution function
Hi, I have just started using R. Now I have the following problem: I want to create an Empirical Cumulative Distribution Function and I only came so far: F10 <- ecdf(x) plot(F10, verticals= TRUE, do.p = TRUE, lwd=3) x=c(1.6,1.8,2.4,2.7,2.9,3.3,3.4,3.4,4,5.2) Now I'd like to use arguments such as xlabs and main but I don't know how to integrate them. I hope someone can help me, I am
2011 Oct 05
0
How to get the hazard of coxph (not cumulative hazard)
Dear all, I think the coxph and survfit.coxph can give the cumulative hazard of cox model. But is there any method to calculate the hazard Lambda(t)=lambda_0(t)*exp{beta*X(t)}? Any suggestion will be great help. Thank you very much! Koshihaku -- View this message in context: http://r.789695.n4.nabble.com/How-to-get-the-hazard-of-coxph-not-cumulative-hazard-tp3873516p3873516.html Sent from the R
2008 Feb 08
0
Cumulative multinomial regression using VGAM
Hi, I am trying to carry out a multinomial regression using the cumlogit link function. I have tried using the VGAM package, and have gotten some results... fit1 <- vgam(Y ~ X1 + X2 + X3 + X4, cumulative(link=logit,intercept.apply=FALSE,parallel=TRUE), data = data1 ) The problem arrises when I try to get the information out of the fitted object. I can
2011 Aug 16
0
cuminc() in cmprsk package for cumulative incidence
Hi, To use cuminc() from cmprsk package, if a subject has 2 events (both the event of interest and the event of competing risk), should I create 2 observations for this subject in the dataset, one for each event with different fstatus (1 and 2), or just 1 observation with whatever event that happened first? My analysis objective is calculate cumulative incidence for the event of interest.
2008 Jan 05
2
Cumulative sum of vector
Hi, Maybe I have not been looking in the right spot, but, I have not been able to fine a command to automatically calculate the running cumulative sum of a vector. Is there such a command? Example of current code: > eig$values [1] 678.365651 6.769697 2.853783 > prop<-eig$values/sum(eig$values) > prop [1] 0.986012163 0.009839832 0.004148005 >
2007 Oct 07
1
a function to compute the cumulative distribution function (cdf) of the gamma
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible Url : https://stat.ethz.ch/pipermail/r-help/attachments/20071006/065906cc/attachment.pl