similar to: for() loop

Displaying 20 results from an estimated 30000 matches similar to: "for() loop"

2020 Aug 23
3
clang performing worse than gcc for this loop
I am analyzing a clang 10.0.0 vs gcc 7.3 performance difference that I can reproduce in the following test. unsigned foo(unsigned t1, unsigned t2, int count, int step) { unsigned tmp = 0; int state = 0; for (int i = 0 ; i < count ; i += step) { state++; if (state > 5) state = 0; if (state == 3) tmp += t2; } return tmp; }
2002 Apr 02
1
cbind.ts bug?
The following creates a time series tt1 whose values rise from 1 to 20 and another time series tt2 each of whose values are 10 larger than the corresponding value in tt1. When we attempt to bind them together as columns, the entry after Dec 1960 is erroneously listed as NA 1960 instead of Jan 1961. If n is changed to either 19 or is changed to 21 in the example below, the example suddenly
2010 Feb 04
1
replace a for loop with lapply or relative
Dear helpers. I often need to make dichotomous variables out of continuous ones (yes, I realize the problems with throwing away much of the information), but I then like to check the min and max of each category. I have the following simple code to do this that cuts each variable (x1,x2,x3) at the 90th percentile, and then prints the min and max of each category:
2006 Oct 11
3
for loop not working in function
I'm trying to write a small function (below) to compute Box & Cox transformations of x for arbitrary values of lambda. I'd like to specify a range of values for lamba (min,max,step) and am having trouble getting the for loop to work. Suggestions? Any pointers to resources for learning to write functions in R for neophyte programmers? Thanks. --Dale boxcox <-
2009 Jan 07
12
glusterfs alternative ? :P
I know that this is not the appropriate place :). You know someone can alternative to gluserfs ?:) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://supercolony.gluster.org/pipermail/gluster-users/attachments/20090107/63b68a0d/attachment.html>
2008 Oct 10
1
Correlation among correlation matrices cor() - Interpretation
Hello, If I have two correlation matrices (e.g. one for each of two treatments) and then perform cor() on those two correlation matrices is this third correlation matrix interpreted as the correlation between the two treatments? In my sample below I would interpret that the treatments are 0.28 correlated. Is this correct? > var1<- c(.000000000008, .09, .1234, .5670008, .00110011002200,
2013 Dec 13
2
how do I separete coloumns by comma?
Hi every one, I have a text file like this: 1    4   4    1    6    23 1   4    2    2    3    28 1    4    5    1    2    24 1    2    3    1    1    24 1   2    3    1    2     40 1   2   3    1    4      22 I want to separate columns by comma, like this: 1,4,4,1,6,23 1,4,2,2,3,28 1,4,5,1,2,24 1,2,3,1,1,24 1,2,3,1,2,40 1,2,3,1,4,22   I used this code:
2010 Apr 27
5
get means of elements of 5 matrices in a list
I've got a list of 5 matrices that are each 5 x 6. I'd like to end up with a 5 x 6 matrix that contains the mean value of the 5 original matrices. I can do this by brute force, but there must be a better way than making each matrix into a vector and then remaking a matrix thanks very much for any help david freedman ll=list(structure(c(9.7, 17.6, 20.8, 24.1, 33.8, 14.5, 25.7, 29.8,
2008 Mar 25
2
Newbie question
I have 2 tables,T1 and T2. There are 4 columns of T1 and 2 columns of T2 T2 1. 990334. G000021 2. 844047. G000025 3. 281739. G000037 4 280903. G002615 5 418546. G004657 The data in T1 V1 V2 V3 V4 1 T00015 AFP1 human G004657 2 T00035 AP-2alphaA human G002615 3 T00036 AP-4 human G003918 4 T00040 AR human G004953 5 T00045
2001 Jul 09
3
transitions in R
Hi, All. I'd have a set of data in an array: process <- c( 5 , 7 , 4 , 1 , 4 , 1 , 4 , 1 , 4 , 4 , 1 , 5 , 4 , ...) and I'd like to know the number of transitions in this data. I calculate transitions as the number of times a number follows another number. thus, something like this would be a 1 deep transition: 1 --> 1 : 10% (and actual number of 1 --> 1 occurrences) 1
2008 Sep 05
8
Gluster update | need your support
Dear Members, Even though Gluster team is growing at a steady phase, our aggressive development schedule out phases our resources. We need to expand and also maintain a 1:1 developer / QA engineer ratio. Our major development focus in the next 8 months will be towards: * Large scale regression tests (24/7/365) * Web based monitoring and management * Hot upgrade/add/remove of storage nodes
2008 Jul 20
2
fill in area between 2 lines with a color
Hi - I'd like to have the area between 2 lines on a x-y plot be filled with grey, but I haven't had any luck using polygon or rect. (In reality, I'd like to do this for twice - once for a low group and once for a high group - and then I'd like to plot a set of data points for a 'normal' group together with these 2 grey areas.) Here's a simple example of the 2 lines:
2010 Mar 16
1
cut out single lines out of matrix
Hey dear users I'm trying to kind of split my matrix which looks as follows: > dim(out) [1] 30 12 What I finally want is each line as it's own matrix which I can handle then separately. Like, say: out1<- [1,] out2<-[2,] ...... Would you do that with a for() loop or does exist an other appropriate solution? I unfortunately couldn't find any solution! Thanks for help
2004 Feb 16
1
understanding loops for "loop-plotting"
Hi, i make some practice on "loops" to understand this important issue in "difference" to the wrappers like apply finally! The point is that i want plot's for different different const and wish in one pdf the 5 plots . So i want plots for const=1:5 which change the undelying data expressed in t1 and t2. I attempt some trials , while, for and now repeat loop now ,
2010 Nov 29
3
data.frame and formula classes of aggregate
Hi - I apologize for the 2nd post, but I think my question from a few weeks ago may have been overlooked on a Friday afternoon. I might be missing something very obvious, but is it widely known that the aggregate function handles missing values differently depending if a data frame or a formula is the first argument ? For example, (d<- data.frame(sex=rep(0:1,each=3),
2010 Feb 06
4
Plot of odds ratios obtained from a logistic model
Hi all! I am trying to develop a plot a figure in which I would like to show the odds ratios obtained from a logistic model. I have tried with the dotplot option but no success. Could you help me? Is there any option when modelling the logistic model in R? Thank you in advance
2015 Jun 03
3
[LLVMdev] [lld] TBSS wrong size
Hi, Yes, ldd is generating wrong tbss size. It is just considering one tbss section and not calculating all sections from all objects. The following example on x86_64 shows the issue: --- t0.c --- #include <stdio.h> extern __thread int t0; extern __thread int t1; extern __thread int t2; extern __thread int t3; __thread int t4; __thread int t5; __thread int t6; __thread int t7; int
2009 May 25
3
long format - find age when another variable is first 'high'
Dear R, I've got a data frame with children examined multiple times and at various ages. I'm trying to find the first age at which another variable (LDL-Cholesterol) is >= 130 mg/dL; for some children, this may never happen. I can do this with transformBy and ddply, but with 10,000 different children, these functions take some time on my PCs - is there a faster way to do this in R?
2010 May 06
4
sample size for survival curves
Dear R users, I am not asking questions specifically on R, but I know there are many statistical experts here in the R community, so here it goes my questions: Freedman (1982) propose an approximation of sample size/power calculation based on log-rank test using the formula below (This is what nQuery does): (Z(1-?/side)+Z(power))^2*(hazard.ratio+1)^2 N =
2007 Feb 20
1
Mahalanobis distance and probability of group membership using Hotelling's T2 distribution
I want to calculate the probability that a group will include a particular point using the squared Mahalanobis distance to the centroid. I understand that the squared Mahalanobis distance is distributed as chi-squared but that for a small number of random samples from a multivariate normal population the Hotellings T2 (T squared) distribution should be used. I cannot find a function for