# search for: sum

Displaying 20 results from an estimated 2700 matches for "sum".

2005 Jul 28
4
Cochran-Armitage-trend-test
Hi! I am searching for the Cochran-Armitage-trend-test. Is it included in an R-package? Thank you! --
2007 Oct 18
12
first cut at blockless given/when/then
Hi all, I committed a first cut at blockless Givens/Whens/Thens to RSpec''s trunk: cd /path/to/rspec/project svn up cd rspec bin/spec examples/story/calculator.rb Take a look at examples/story/calculator.rb to see what''s going on. Needs docs!!!! Thoughts welcome. I''ve also got a cut at the plain text parser checked in, but
2013 Jun 27
8
using "rollapply" to calculate a moving sum or running sum?
#using "rollapply" to calculate a moving sum or running sum? #I am tryign to use rollapply to calcualte a moving sum? #I tried rollapply and get the error message #"Error in seq.default(start.at, NROW(data), by = by) : # wrong sign in ''by'' argument" #example: mymatrix <- ( matrix(data=1:100, nrow=5, ncol=20)...
2009 Jun 19
3
Alternate ways of finding number of occurrence of an element in a vector.
Hi, I have a vector "v" and would like to find the number of occurrence of element "x" in the same. Is there a way other than, sum(as.integer(v==x)) or length(which(x==v)) to do the this. I have a huge file to process and do this. Both the above described methods are pretty slow while dealing with a large vector. Please have your comments. Praveen Surendran. [[alternative HTML version deleted]]
2011 Aug 23
8
Bug or feature? sum(c(a, b, c)) != (a + b + c)
Greetings all, I''m porting an algorithm from MATLAB to R, and noticed some minor discrepancies in small decimal values using rowSums and colSums which are exacerbated after heavy iteration and log space transformation. This was rather perplexing as both programs claimed and appeared to use the IEEE 754 standard for floating point arithmetic (confirmed with manual basic operations). After some tracing and testing, I'...
2011 Apr 13
6
Decimals in R/SQL
...in sqldf or RSQLite I lose the decimals in my matrix. The only way I can get decimals is by multiplying by 1.00000, etc. I have tried manipulating the options, but it is only effective once I multiply by 1.0000. I appreciate any suggestions! Thanks! Example: z <- sqldf ("select ST, SUM(AGEP*PWGTP)*1.000000000/SUM(PWGTP)*1.00000000000000 as wgtage from ss09 group by ST") z shouldn''t be whole numbers. [[alternative HTML version deleted]]
2008 Apr 18
5
show sum of textboxes
Hi all, I have multiple textboxes containing numbers. I want to add up all the numbers and show the sum. Can I select the textboxes by class and sum the content? This also has to happen realtime: when a number is changed ina textbox the sum should also change. can this be done? regards, Stijn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed...
2010 Mar 12
3
Problem installing new packages
...''http://cran.cnr.Berkeley.edu/bin/windows/contrib/2.10/RColorBrewer_1.0-2.zip'' Content type ''application/zip'' length 23875 bytes (23 Kb) opened URL downloaded 23 Kb package ''mnormt'' successfully unpacked and MD5 sums checked package ''mvtnorm'' successfully unpacked and MD5 sums checked package ''scatterplot3d'' successfully unpacked and MD5 sums checked package ''sn'' successfully unpacked and MD5 sums checked package ''pspline'' successfully unp...
2018 Jan 15
3
barplot that displays sums of values of 2 y colums grouped by different variables
I am trying to create a barplot displaying the sums of 2 columns of data grouped by a variable. the data is set up like this: "city" "n" "y" <br> mon 100 200 <br> tor 209 300 <br> edm 98 87 <br> mon 20 76 <br> tor 50 96 <br> edm 62 27 <br> the resulting plot should have city...
2006 Jan 02
5
How to use MySQL sum() to get total of column?
Easy one: Let''s say I have a table called ''employees'' with a column called salaries, how can I add Employee.salaries_total to the model? Thanks! -- Posted via http://www.ruby-forum.com/.
2008 May 12
3
Enumeration sum
Any idees why I can do this: @sum = @selected.inject(0) { |sum, player| sum + player.value } but not this: @sum = @selected.sum { |player| player.value } @sum = @selected.sum(&:value) The last two give me following error: wrong number of arguments (1 for 2) /Library/Ruby/Gems/1.8/gems/activerecord-2....
2013 Jan 24
12
group by + sum
Hi.. I need some support... table: week_id, user_id, project_id, hours ex. => 33, 2, 1, 10 34, 2,1,15 33, 2, 2, 20 35, 3, 1,20 etc. Want to display a sum of hours per week_id per user_id I have: @hours = HourUser.includes(:user).group_by { |h| h.week_id } @hours.keys.sort.each do |hour| @hours[hour].collect(&:stunden).sum Hours are summed up, but not sorted by user_id.. How to get that? Thanks Werner -- You received this message becau...
2017 Aug 17
3
unable to emit vectorized code in LLVM IR
...a text file) will be added using AVX vector instructions. as you pointed; When i changed my code to following: int main(int argc, char** argv) { int a, b, c; int aa=atoi(argv), bb=atoi(argv); for (int i=0; i<1000; i++) { a[i]=aa, b[i]=bb; c[i]=a[i] + b[i]; printf("sum: %d\n", c[i]); } I am getting error remark: <unknown>:0:0: loop not vectorized: call instruction cannot be vectorized. I am running following commands: clang -S -emit-llvm sum-vec.c -march=knl -O3 -mllvm -disable-llvm-optzns -o sum-vec.ll opt -S -O3 -force-vector-width=64 sum-vec.ll...
2017 Aug 17
4
unable to emit vectorized code in LLVM IR
i removed printf from loop. Now getting no error. but the IR doesnot contain vectorized code. IR Output is as follows: ; ModuleID = 'sum-vec.ll' source_filename = "sum-vec.c" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: norecurse nounwind readnone uwtable define i32 @main(i32, i8** nocapture readnone) local_unnamed_addr #0...
2008 Jul 14
4
how to correlate nominal variables?
Dear R-Users, I need functions to calculate Yule''s Y or Cram?rs Index, in order to correlate variables that are nominally scaled? Am I wrong? Are such functions existing? Sincerely, Timo
2017 Aug 16
2
unable to emit vectorized code in LLVM IR
Hello, I have written the following code. when i try to vectorize it through opt. i am not getting vectorized instructions. #include <stdio.h> #include<stdlib.h> int main(int argc, char** argv) { int sum=0; int a=atoi(argv); int b=atoi(argv); for (int i=0;i<1000;i++) { sum+=a+b; } printf("sum: %d\n", sum); return 0; } i use following commands: clang -S -emit-llvm sum-main.c -march=knl -O3 -mllvm -disable-llvm-optzns -o sum-main.ll opt -S -O3 -force-vector-width=64 sum-main.ll...
2018 Feb 12
1
Pattern not recognized as reduction
Reduction Not Captured By LLVM CODE_1 ------------------------------------------------------------ ------------------------------------------------------------ -------------------- #include <stdio.h> int main() { int sum={1,2,3,4}; for (int i=1;i<1000;i++) { sum +=sum[i-1]; } } ------------------------------------------------------------ ------------------------------------------------------------ -------------------- In the code given above, we tried to run t...
2013 Mar 28
0
using cvlm to do cross-validation
Hello, I did a cross-validation using cvlm from DAAG package but wasn''t sure how to assess the result. Does this result means my model is a good model? I understand that the overall ms is the mean of sum of squares. But is 0.0987 a good number? The response (i.e. gailRel5yr) has min,1st Quantile, median, mean and 3rd Quantile, and max as follows: (0.462, 0.628, 0.806, 0.896, 1.000, 2.400) ? The plot generated by cvlm, the point does not look too tight. Thanks in advance > CVlm(gailRel5yr~risk....
2009 Dec 03
9
Two-way/Three-way sum.
Hi R Users, I''m wondering how can I calculate two (or three) way sum of a variable. A sample data is: State Month Year Value NC Jan 1996 1 NC Jan 1996 2 NC Feb 1997 2 NC Feb 1997 3 NC Mar 1998 3 NC Mar 1998 4 NY Jan 1996 4 NY Jan 1996 5 NY Feb 1997 5 NY Feb 1997 6 NY Mar 1998 6 NY Mar 1998 7 I''m trying to sum up "value" column by State*Month and...
2007 Aug 07
0
Goodman-Kruskal tau
...[,1] [,2] [,3] [1,] 30 10 1 [2,] 2 20 5 [3,] 1 10 15 > GK.tau(x) tau.RC tau.CR p.tau.RC p.tau.CR var.tau.RC ASE.tau.RC 1 0.3522439 0.3219675 2.002024e-13 3.065436e-12 0.004584542 0.06770924 ASE.tau.CR 1 0.07004566 GK.tau <- function(dat) { N <- sum(dat); dat.rows <- nrow(dat); dat.cols <- ncol(dat); max.col <- sum.col <- L.col <- matrix(,dat.cols); max.row <- sum.row <- L.row <- matrix(,dat.rows); for(i in 1:dat.cols) { sum.col[i] <- sum(dat[,i]); max.col[i] <- max(dat[,i]); } for(i in 1:dat.rows...