search for: tsum

Displaying 7 results from an estimated 7 matches for "tsum".

Did you mean: sum
2007 Dec 06
5
Help rewriting looping structure?
...gh all records across 5 fields to calculate the cumulative percentage of each record (relative to each individual field). Is there a way to rewrite it so I don't have to loop through each individual record? ##### tdat is my data frame ##### j is my field index ##### k is my record index ##### tsum is the sum of all values in field j ##### tmp is a vector containing the values in field j ##### tdat[k,paste("cpct,j,sep="")] creates new fields "cpct1",...,"cpct5" for(j in 1:5) { tsum<- sum(tdat[,j]); for(k in 1:nrow(tdat)) { td<- tdat[k,j];...
2003 Dec 30
1
Accuracy: Correct sums in rowSums(), colSums() (PR#6196)
...lt; n) { ! if (ISNAN(*rx)) { ! if (keepNA) {sum = NA_REAL; break /* switch */;} ! } else { ! cnt++; sum = *rx; ! } ! i++; rx++; ! } ! for (; i < n; i++, rx++) ! if (!ISNAN(*rx)) { ! /* Kahan summation */ ! double yhilo = *rx - correction; ! double tsum = sum + yhilo; ! correction = (tsum - sum) - yhilo; ! sum = tsum; ! cnt++; ! } else if (keepNA) {sum = NA_REAL; break;} #endif break; *************** *** 1121,1137 **** switch (type) { case REALSXP: rx = REAL(x) + i; #ifdef IEEE_754 if (keepNA) !...
2012 Mar 09
2
Create a list object in a loop
..., I'm trying to create a list of point patterns ppp.object {spatstat} in a loop. My dataset looks like this: > names(OT1);head(OT1);dim(OT1) [1] "EID" "latitude" "longitude" "month" "year" "CPUE" "TSUM" [8] "fTSUM" EID latitude longitude month year CPUE TSUM fTSUM 1 167-1-1996-1135 67.70000 -61.81667 9 1996 0 0 F 2 167-10-1996-1135 67.71667 -59.18333 9 1996 0 0 F 3 167-100-1996-1135 67.86667 -59.43333 10...
2012 Sep 20
3
(no subject)
>From my book on corpus linguistics with R: # (10) Imagine you have two vectors a and b such that a<-c("d", "d", "j", "f", "e", "g", "f", "f", "i", "g") b<-c("a", "g", "d", "f", "g", "a", "f", "a",
2007 Feb 08
3
Get categories where forum-user posted in
I''m developing a system similar to the ForumExample (http:// wiki.rubyonrails.org/rails/pages/ForumExample), and stumbled upon the following. Let''s say I wanted to get all the categories a certain user posted in. How do I get that information withouth using a custom query through :finder_sql (and thus losing the find_in_collection ownage)? It would also be great to see how many
2011 Jan 09
1
Operating on count lists of non-equal lengths
This is my first post to R-help and I look forward receiving some advice for a novice like me... I?ve got a simple repeated (4 periods so far) 10-question survey data that is very easy to work on Excel. However, I?d like to move the compilation to R but I?m having some trouble operating on count list data in a neat way. The data C > str(C) 'data.frame': 551 obs. of 13
2023 Oct 09
3
Deleting voicemail by program
Hi all, I need to be able to delete a voicemail message using a program. Is is sufficient to simply delete the .wav and .txt files in the spool directory? Or do I need to also renumber the remaining files? For example, let say a given mailbox has 20 messages in it and I want to delete message number 5. Can I just delete the 2 files and expect that asterisk will renumber them? Or do I