search for: indicies

Displaying 20 results from an estimated 63 matches for "indicies".

Did you mean: indices
2010 Nov 17
3
translate vector of numbers to indicies of 0/1 matrix
Hello All, Searched around, haven't found a decent solution. I'd like to translate a vector of numbers to a matrix (or to a list of vectors) such that the vector values would serve as indicies of the 1's in an otherwise-zero-filled matrix (or list of vectors). For example: > a = c(1,3,3,4) # perform operation [,1] [,2] [,3] [,4] [1,] 1 0 0 0 [2,] 0 0 1 0 [3,] 0 0 1 0 [4,] 0 0 0 1 Any help greatly appreciated! thanks, allie
2019 May 02
2
llvm is illegally vectorizing with a recurrence on skylake
...*restrict in, const int *const end, const unsigned shift, int *const restrict index, int *const restrict out) { do out[index[(*in>>shift)]++]=*in; while(++in!=end); } #endif void parent( int digits, int n, int *restrict work, int * restrict idx, int *restrict shift, int **restrict indicies) { int *in = work; int *dst = work+n; // int *indicies[1024]; // int shift[1024]; int d; for(d=1;d!=digits-1;++d) { int *t; one(in,in+n,shift[d],indicies[d],dst); t=in,in=dst,dst=t; } #ifndef NO_TWO two(in,in+n,shift[d],indicies[d],idx); #endif } /*************************...
2003 May 12
1
Plotting expressions with indicies
Hello, I would like to plot a series of math symbols on a graph with ordered indicies : expression(delta[1]) expression(delta[2]) etc. Is there a mean to write this in a for loop ? for(i in 1:6) text(i,i,expression(delta[i])) does not work ('i' is not evaluated). Thanks in advance, Y. Noel
2011 Feb 26
0
Weird behavior of a 2-by-2 matrix indicies
The real weird thing is I wrote "weird" and it comes out "wired"... The background is that I did a lot of sparse matrices calculations. Therefore need some indices tweaks, e.g subtract a block from a big matrix. Then I just create an indicies matrix and use it directly as a vector since a matrix is just a vector with dimensions attributed in R. I know I can convert them to a vector but I did not do it anyway. Thanks for this information! Feng On Sat, Feb 26, 2011 at 6:29 PM, Sarah Goslee <sarah.goslee@gmail.com>wrote: > Hel...
2009 Jul 09
1
Converting indices of a matrix subset
...atrix(1,4,4) > m1 [,1] [,2] [,3] [,4] [1,] 1 1 1 1 [2,] 1 1 1 1 [3,] 1 1 1 1 [4,] 1 1 1 1 > m2 <- matrix(0,3,3) > diag(m2) <- 1 > m2 [,1] [,2] [,3] [1,] 1 0 0 [2,] 0 1 0 [3,] 0 0 1 I want to get indicies from m2 such that they match indicies as though they came from the lower right of m1. Here's how things work: > ind1 <- which(m1 == 1) > ind1 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 > ind2 <- which(m2 == 1) > ind2 [1] 1 5 9 I would like ind2 to be offset so the...
2011 Feb 26
1
Wired behavior of a 2-by-2 matrix indicies
Dear R, I found a very wired behavior for a 2-by-2 matrix, see this example > A <- matrix(1:4, 2) > idx4A <- matrix(1:4, 2) > A[idx4A] Error in A[idx4A] : subscript out of bounds But other matrices are fine, > B <- matrix(1:9, 3) > idx4B <- matrix(1:9, 3) > B[idx4B] [1] 1 2 3 4 5 6 7 8 9 I can reproduce this for both 32bit windows and 64bit linux with R 2.12.1
2003 Mar 31
2
Using R2HTML
Hello, I''m using R2HTML library to make a HTML page output (both data frames and graphics): HTMLStart(outdir=paste(getwd(),"/prove html", sep = ""),filename="index", echo = F, HTMLframe = T, withprompt = "HTML> ", CSSFile = "R2HTML.CSS", Title = "Indici di attivit?") ...
2002 Mar 17
2
using "by" and indicies
I sent this to the list last week, and haven't seen it pop up. Either I deleted it when it did appear, or possibly it was destroyed as spam...? If it did appear and I somehow missed it, appologies. In a nutshell, can the function FUN supplied to by() deduce what level of factor by() was on when FUN was called? I've been digging through the functions, and can't see where the
2011 Dec 12
3
For loop indicies
I would like to run a for loop with an index going from 0 to 499 but the following seems to miss out the first value: C <- 499 for (i in 0:C) The alternative is: C <- 500 for (i in 1:C) { #Then every time I use i, I replace it with i-1 } Is this a good way to do it or is tere a better way? Thank you, ThomasThis message and any attachment are intended solely for the addressee and may
2009 Jun 11
2
Tables without names
...unname'd tables: In plot, they are considered erroneous input: > plot(unname(table(2:3))) Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ but in melt, they act as though they have names 1:n: > melt(unname(table(2:3))) indicies value 1 1 1 2 2 1 (By the way, is the spelling error built into too much code to be corrected?) -s PS What is the standard way of extracting just the underlying vector? c(unname(...)) works -- is that what is recommended? [[alternative HTML version del...
2009 Jan 17
2
Confidence Interval
I am new to R and Im some trouble with the following question... Generate 100 standard normal N(0,1) samples of size 100, X1(k),...,X100(k) where k=1,...,100 (The k is and indicie in brackets) Calculate the sample mean for each sample. For each sample mean Xbark the 0.95-confidence interval for the mean mew=0 is given by... Ik= ( Xbark plus or minus 1.96/10) Find the number of intervals such
2007 Jan 30
3
How to find series of small numbers in a big vector?
...rce hard-code an R program, but perhaps an expert can give me a tip for an easy, elegant existing function or a tactic to approach? Execution speed or algorithm performance is not, for me in this case, important. Rather, I seek an easy R solution to find the time windows (starting & ending indicies) where 5 or more small numbers in my search_range were measured all in a row. Advice welcome and many thanks in advance. Ed Holdgate
2004 Sep 10
1
mistake in FLAC++ metadata interface?
Hi all, Using the FLAC++ level 2 metadata interface the following function doesn't do what you would expect: cuesheet->get_track(i).get_num_indices(); (where cuesheet is a FLAC::Metadata::CueSheet *) It returns a bool instead of an int, why is this? To get the mumber of indicies in a track I need to use: cuesheet->get_track(i).get_track()->num_indices; ie. retrieve the C struct and get it from there. Is this a mistake in include/FLAC++/metadata.h ? ie should line 609 be: inline FLAC__byte get_num_indices() const { return object_->num_indices; } rather than: inli...
2007 May 11
1
conditional across frames of a data fram
...... ... 120 129 ... ... ... ... ... 0 0 ... ... ... ... ... 135 162 .... ... ect... i need to ask R tell me how many x-y pairs contain coords that are non-zero and fall within values that i'm callilng xleft, xright, ybottom and ytop and fall between certain indicies of the data frame. i am calling the indexes by referring to numbers i have storied in other variables. i am really looking for an efficient way to do this since when i try to pull the x and y columns out and assign them to their own variables, the process of asking for the number of non-zeros whic...
2011 Aug 31
1
unequal bins in filled.contour
Hello, I am trying to plot SADIE red-blue plots of cluster indicies using filled.contour. I want a plot which only has three bins for the data: <-1.5, -1.5 - 1.5, >1.5, but I am having trouble getting there. example X1 X2 X3 X4 X5 1 -5 -4.5 1.0 4.5 6 2 -3 -2.0 1.2 -1.0 3 3 0 0.0 0.0 -0.5 -1 4 -2 -3.0 1.0 1.5 3 5 -6 -2.0 0.5 3.0 2 example<...
2005 Jun 07
1
Specifying medoids in PAM?
...build__ algorithm things work well: > pam(stats.table, metric="euclidean", stand=TRUE, k=5) But I have some clusters from a Hierarchical analysis that I would like to use as seeds for the PAM algorithm. I can't figure what the mediod argument wants. When I put in the five integer indicies for the observations in stats.table that I would like to use as seeds (the row numbers), I segfault R. > pam(stats.table, metric="euclidean", stand=TRUE, medoids=c(1,3,20,2,5), k=5) *** R Crashes *** Here is my version info: > version _ platform i386-pc-min...
2005 Jun 17
2
Speex granulepos definition
...With vorbis it's the 'count of decodable samples including this packet'. So if you had a packet that allowed you to decode 1024 samples since the beginning of playback, the granulepos is 1024, not for example 1023 which would be the *index* of the last sample assuming C-style array indicies starting at 0. Put another way, if you had a speex stream that encoded only one sample in one packet in one page, what would be the granulepos of that page? I'm trying to figure out (with Thomas and Conrad) what all the codec implementations actually do so we can nail down the spec and/or...
2008 Jan 11
1
Oddities with RSiteSearch?
...xt "Namazu" is a link to http://www.namazu.org/, which, when clicked on, starts a download rather than displaying a page. Also, the email address at the bottom, foobar at namazu.org, is suspicious. I realize that these last two errors might be caused by the system RSiteSearch uses to form indicies, but we may want to suppress them until that organization gets them working correctly. Thanks for your efforts in setting up the RSiteSearch system; I use it all the time. -Kevin Kevin Zembower Internet Services Group manager Center for Communication Programs Bloomberg School of Public Health Jo...
2012 Apr 22
1
Sending lists using .C
...and Gcompat[[1]][[3]] = 1, 3, 6. So Gcompat[[i]][[j]] = list of integers, where 1<=i<=47, 1<=j<=7. I have written the following code which will let me pass it through using .C as two vectors, one containing the numbers contained in the lists all concatenated, the other containing the indicies at which each list starts. ######### Gcompat_values = vector() Gcompat_lengths = vector() Gcompat_indicies = as.vector(0) for(i in 1:S) { for (j in 1:L) { Gcompat_values = c(Gcompat_values, Gcompat[[i]][[j]]) Gcompat_lengths = c(Gcompat_lengths, length(Gcompat[[i]][[j]])) } } f...
2012 Aug 16
1
Big Data reading subsample csv
...and 3000 (mostly categorical data) columns in csv format. I want to bootstrap subsamples for multinomial regression, but it's proving difficult even with my 64GB RAM in my machine and twice that swap file , the process becomes super slow and halts. I'm thinking about generating subsample indicies in R and feeding them into a system command using sed or awk, but don't know how to do this. If someone knew of a clean way to do this using just R commands, I would be really grateful. One problem is that I need to pick complete observations of subsamples, that is I need to have all the rows...