similar to: R loops

Displaying 20 results from an estimated 50000 matches similar to: "R loops"

2008 Jan 30
4
Loop with variable index
I have a list of 20 values. The first time through a loop I want to find the mean and stnd.dev. of the first two values; the second time through the loop I want to find the mean and stnd. dev. of the first 3 values, etc. until the last time through the loop I want to find the mean and stnd. dev. of all 20 values, so I end up with 19 means and stnd. deviations. How would I construct such a loop?
2008 Feb 26
4
numeric format
Hi! I'm an R newbie and this should be a trivial problem, but I can't make it work and cannot find what I'm doing wrong in the literature. I entered the the command: table<-data.frame(x, scientific=F, digits=4) table This prints a column of x with 16 useless decimal places after the decimal point. Also, it prints an unwanted index number (1-20) in the left column. How do I get rid
2009 Jul 08
2
Formatting a Table
I've created a short program to print a table of learning curve factors. However, I cannot figure out how to format the table to: 1) Get rid of the [1]s in the first column and replace it with the values of N. 2) Line up the first row with the factors (decimal fractions). Thanks for any help. The complete program and output is as follows: > Lc<-seq(0.70,0.95,0.05) #Specify learning
2011 Jun 01
3
Zero-inflated regression models: predicting no 0s
Hi all, First post for me here, but I have been reading on the forum for almost two years now. Thanks to everyone who contributed btw! I have a dataset of 4000 observations of count of a mammal and I am trying to predict abundance from a inflated-zero model as there is quite a bit of zeros in the response variable. I have tried multiple options, but I might do something wrong as every
2005 Jun 21
2
Problem trying to use boot and lme together
The outcome variable in my dataset is cost. I prefer not to transform it as readers will really be interested in pounds, not log(pounds) or sqrt(pounds). I have fitted my model using lme and now wish to use boot on it. I have therefore plagiarised the example in the article in RNews 2/3 December 2002 after loading the dataset I source this file
2008 Feb 02
1
Plotting 3 vectors on one graph.
I'm an R newbie and am trying to plot 3 vectors, say a,b,c. I have downloaded 3 R manuals and searched your forum. There are plenty of X vs Y examples, but cannot find how to plot 3, or more vectors one one graph. I'm sure I overlooked something. Thanks for any help. CHV -- View this message in context: http://www.nabble.com/Plotting-3-vectors-on-one-graph.-tp15236552p15236552.html
2007 Sep 10
2
Are the error messages of ConstrOptim() consisten with each other?
Dear Friends. I found something very puzzling with constOptim(). When I change the parameters for ConstrOptim, the error messages do not seem to be consistent with each other: > constrOptim(c(0.5,0.3,0.5), f=fit.error, gr=fit.error.grr, ui=ui,ci=ci) Error in constrOptim(c(0.5, 0.3, 0.5), f = fit.error, gr = fit.error.grr, : initial value not feasible > constrOptim(c(0.5,0.9,0.5),
2004 Sep 28
3
slow loops in Monte Carlo Simulations
Hi there, I am running Monte Carlo Simulations in R using ordinary "while (condition)" loops. Since the number of iterations is something like 100.000 and within each iteration a given subsample is extended sequentially it takes hours to run the simulation. Does anyone know if there is either a way to avoid using loops in Monte Carlo Simulations or how to include possible faster
2009 Feb 08
5
glmmBUGS: logistic regression on proportional data
Hello, I am trying to run a logistic regression with random effects on proportional data in glmmBUGS. I am a newcomer to this package, and wondered if anyone could help me specify the model correctly. I am trying to specify the response variable, /yseed/, as # of successes out of total observations... but I suspect that given the error below, that is not correct. Also, Newsect should be a
2007 Aug 04
2
multiple nls - next fit even after convergence problem
Hello R-gurus, I'm trying to adjust different growth curves to a rather extensive dataset. I wrote up a function to go through all of them, but am encountering a problem : among the more than 1000 curves I have, obviously for some of them I encounter conversion problems. I'd like for my function to keep going to the next curve and store the fact that for curve number X I had a convergence
2012 Aug 07
2
Error using ddply inside user-defined function
Hi All, I *think* it's ddply because the function recognizes vr1, etc, in other parts of the function. Here's some code: # create dataset PROV.PM.FBCTS <- c(0.00 ,0.00, 33205.19, 25994.56, 23351.37, 26959.56 ,27632.58, 26076.24, 0.00, 0.00 , 6741.42, 18665.09 ,18129.59 ,21468.39 ,21294.60 ,22764.82, 26076.73) FBCTS.INV.TOT <- c(0 , 0, 958612, 487990, 413344, 573347,
2008 Jul 07
3
[LLVMdev] Trying to compile llvm-gcc to mips
Hi, well, I downloaded the head revision of llvm and llvm-gcc. As you said it hangs at: Formal argument #0 has unhandled type f32 /home/julio/trunk/llvm-gcc/gcc/libgcc2.c:1765: internal compiler error: Abortado Please submit a full bug report, with preprocessed source if appropriate. Actually, I don't need fp, there is any way to disable? By the way, I'm working with a MIPS coprocessor
2008 Jul 06
0
[LLVMdev] Trying to compile llvm-gcc to mips
Hi Julio, On Sun, Jul 6, 2008 at 1:58 PM, Julio <julio.martin.hidalgo at gmail.com> wrote: > Hello, I'm trying to compile llvm-gcc to crosscompile mips. I have already > modified a config.gcc to add mips as a target with llvm, but it gives me > "Did not get a target machine!" (from llvm-backend.cpp). > > I thought that I had to modify TargetMachOWriterInfo.h
2015 Mar 19
2
[LLVMdev] [LV] possible `vector.memcheck` regression when using `llvm.loop` and `llvm.mem.parallel_loop_access`
Adam, Please find the attached test case (run with ToT opt -O3). As you can see, `y_body` successfully is vectorized, though %33 and %46 are deemed MayAlias despite their exclusive use in loads ands stores marked with `llvm.mem.parallel_loop_access`. Many Thanks, Josh On Thu, Mar 19, 2015 at 12:55 PM, Adam Nemet <anemet at apple.com> wrote: > > > On Mar 19, 2015, at 9:43 AM,
2015 Feb 18
5
[LLVMdev] [cfe-dev] [3.6 Release] RC3 has been tagged
On 02/18/2015 03:01 PM, Renato Golin wrote: > So it seems that you're one of the very few people that doesn't use > ToT. Almost everyone else uses it and the progress of LLVM kind of > assume you do. My company also does not use ToT. Being able to associate a product with a well-known release is *very* important to us. It enables communication with our customers. It allows
2012 Apr 05
1
reclaiming lost memory in R
Dear list, I am trying to reclaim what I think is lost memory in R, I have been using gc(), rm() and also using Rprof to figure out where all the memory is going but I might be missing something. I have the following situation basic loop which calls memoryHogFunction: for i in (1:N) { dataset <- generateDataset(i) fit <- try( memoryHogFunction(dataset, otherParameters)) } and
2012 Sep 25
2
small negative values instead of zeros in nested loop
Hi,I am trying to run a code with a series of nested for loops, here is a simplified version of it: J<-seq(0,1,0.2) D<-seq(0,1,0.2) for (x in 1:10) { for (j in 1:length(J)) { for (d in 1:(length(D)-j+1)) { x.end<-x*(1-J[j]-D[d]) print(x) print(J[j]) print(D[d]) print(x.end) } }} The problem is that whenever x.end should be zero it takes a
2012 Jun 15
3
moving from loops to apply
Dear subscribers, I have made a simulation using loops rather than apply, simply because the loop function seems more natural to me. However, the current simulation takes forever and I have decided - finally - to learn how to use apply, but - as many other people before me - I am having a hard time changing habits. My current problem is: My current code for the loop is: distances <-
2007 Apr 12
1
GLM with random effects
Hi R-Users, I have 3 replicates ('Replicate) of counts of parasites ('nor.tot.lep') before and after an experiment ('In.Out'). I am trying to treat the three replicates as a random effect in order to determine if the main effect (In.Out) significantly influences my dependent variable (nor.tot.lep) after the variance explained by the replicates is accounted for. I have
2011 Jun 15
3
[PATCH] virtio-net: per cpu 64 bit stats
Use per-cpu variables to maintain 64 bit statistics. Compile tested only. Signed-off-by: Stephen Hemminger <shemminger at vyatta.com> --- a/drivers/net/virtio_net.c 2011-06-14 15:18:46.448596355 -0400 +++ b/drivers/net/virtio_net.c 2011-06-15 09:54:22.914426067 -0400 @@ -40,6 +40,15 @@ module_param(gso, bool, 0444); #define VIRTNET_SEND_COMMAND_SG_MAX 2 +struct virtnet_stats { +