similar to: finding numbers in a range

Displaying 20 results from an estimated 8000 matches similar to: "finding numbers in a range"

2011 Jun 24
1
Fastest way of finding if any members of vector x fall in the range of the rows of matrix y
Hi All, What is the fastest way of finding if any members of vector x fall in the range of the rows of matrix y? I do not want to use two for loops as this will take forever. Any help will be appreciated, best, salih [[alternative HTML version deleted]]
2011 Jun 08
1
install the “impute” package in unix
Hi, I am trying to install the “impute” package in unix. but I get the following error message. I followed the following steps. Do you know what is causing this and how I can solve this problem? source("http://www.bioconductor.org/biocLite.R") biocLite("impute") Using R version 2.11.1, biocinstall version 2.6.10. Installing Bioconductor version 2.6 packages: [1]
2011 May 25
1
help with tune.svm() e1071
Hi, I am trying to use tune.svm in e1071 package. the command i use is tobj <- tune.svm(labels, data= data, cost = 10^(1:2)) Should the last column of the 'data' contain the labels as well? I want to use the linear kernel. But it gives me the error "Error in model.frame.default(formula, data) : 'data' must be a data.frame, not a matrix or an array" Do you know why
2011 Jun 01
1
Force the for loop to stop
Hi, I am looking for a command in R that would force the for loop to stop after it finds what it is looking for. As an example for(i in 1:5){ for(j in 3:6){ if(i==j) # do something... break; } } And i don't want the loop to execute once i = 3 and stop. Is there a way to do this? best, salih [[alternative HTML version deleted]]
2012 Dec 01
3
screen if a value is within range
Dear all,   could you please give me some pointers on how I could make R screen for a value if it falls within a certain range? I looked at the subset function, but is not doing it, perhaps because I only have 1 value to screen?   aptreciate the input   ex: a <-16.5 I would like to screen to see if a is within the range of 15 to 20, (which it is:-)), and I would like the code to return a value
2011 Feb 17
2
does range of values in array include a third value?
I'm using the range command to get the minimum and maximum values of an array as in x <- range(array_y) which gives me two values such as [1] -2 9 I need to be able to test if this range of values includes a third value. For example I'd like to query 1) does the range of -2 to 9 include 3, answer TRUE 2) does the range of -2 to 9 include -6, answer FALSE? All values could be
2010 Mar 14
3
range and intersection
Hi: I have a two large files (over 300K lines). file 1: Name X UK 199 UK 230 UK 139 ...... UAE 194 UAE 94 File 2: Name X Y UK 140 180 UK 195 240 UK 304 340 .... I want to select X of File 1 and search if it falls in range of X and Y of File 2 and Print only those lines of File 1 that are in range of File 2 X and Y How can it be done it
2003 Feb 20
2
subset with NA
Easy question that I can't find an answer for. I'm trying to subset a data frame and want to exclude the positive values, i.e. I want the NA values. My data: > summary(temp$tuna) Min. 1st Qu. Median Mean 3rd Qu. Max. NA's 1 2 3 3 4 5 1211 Querying for subset(temp, tuna %in% "NA", select.... subset(temp, tuna == NA,
2012 Mar 08
2
Classification by range
Given studentNumbers<-10; subjEnglish<-sample(-1:100,studentNumbers,replace=TRUE); when subEnglish <=0, 'U'                         <=39, 'F'                         <=49 'D'                         <=59, 'C'                         <=69, 'B'                         <=79,'A'                         <=100 'A+' I
2010 Sep 02
2
unanswered questions
Hello, Since some months I can not get any feedback from you for my questions in two different account with the same name. I just wonder is there any specific reason for it? Maybe my english is not so clear or I ask wrong questions for wrong lists I don't know but in any case I think I should have been informed. Sincerely Yours Murat Can Tuna
2017 Nov 01
1
Creating Tag
i want to tag categories to its menuname. i have a csv containing menu item name and in other csv i have a column containing some strings, i want to pick that strings from categories and look into menu items if any menu item containing that string i want to create a new column next to menu item name flagged as 1 otherwise 0 and the only condition is once a menu item flagged as 1 i don't need
2009 Sep 11
1
Quo vadis?
Hi, In the course of my experiments with rt kernels it so happens that the gui versions of tuna built from upstream (RHEL, F11) SRPMs show wrong affinity settings for IRQ threads. Where would be a proper place to report this and get some help on other rt-related issues? Thanks, Sasha
2010 Sep 01
2
user permissions
Hello, I have a problem about reaching my share folder when the permission is 750 but whenever I change it to 755 I can see the content of the folder. for 750 I get this result: "smbclient //serverip/sharename -U username" smb: \> ls NT_STATUS_NETWORK_ACCESS_DENIED listing \* 0 blocks of size 0. 9 blocks available smb: \> but for 755 everything is fine but of
2012 Feb 27
1
set heatmap.2 color ranges
Hi all, I have a matrix with values between 0 and 1. I want to plot this matrix on a heat map so anything >0.05 is blue, anything <=0.05 and >0.01 is yellow, and anything else is grey. I am using the heatmap.2 function. I searched around but did not find an efficient way to set colour ranges as I described. Could anybody give some hints? Thank you in advance. Wendy -- View this
2017 Jul 14
2
Efficient Binning
Hi all, I have a situation where I have 16 bins. I generate a random number and then want to know which bin number the random number falls in. Right now, I am using a serious of 16 if() else {} statements which get very complicated with the embedded curly braces. Is there a more efficient (i.e., easier) way to go about this? boundaries<-(0:16)/16 rand<-runif(1) Which bin number (1:16)
2011 May 05
6
Averaging uneven measurements by time with uneven numbers of measurements
I have a new device that takes measurements anywhere from every second, to every 15 minutes (depending on changes). The matrix has a date, time and Y column (Y is the measurement). For three days it is 25,000 rows. How do I average the measurements by every 30 minutes so my matrix is 48 rows per day? I have been working on this and cannot figure out a simple method. Any ideas? Thank you. ----- In
2011 May 21
1
Group close numbers in a vector
Hi everyone, i am trying to group close numbers in a vector. For example i have a vector x = [1 2 4 7 9 10 15]. I want the code to pick 1 2 4 (max difference between successive numbers is 2) and assign them to variable a, then pick 7 9 10 and assign them to b and 15 to c. But since i do not know how many groups there will be the code should create a,b,c etc as it goes along. So if x = [1 2 4 7 9
2011 Dec 06
1
help wrapping findInterval into a function
Dear R Community, I hope you might be able to assist with a small problem creating a function. I am working with water-quality data sets that contain the concentration of many different elements in water samples. I need to assign quality-control flags to values that fall into various concentration ranges. Rather than a web of nested if statements, I am employing the findInterval function to
2016 Aug 04
1
findInterval(all.inside=TRUE) for degenerate 'vec' arguments
What should findInterval(x,vec,all.inside=TRUE) return when length(vec)<=1, so there are no inside intervals? R-3.3.0 gives a decreasing map of x->output when length(vec)==1 and -1's when length(vec)==0. Would '0' in all those cases be better? > findInterval(x=c(10, 11, 12), vec=11, all.inside=TRUE, rightmost.closed=FALSE, left.open=FALSE) [1] 1 0 0 >
2024 Sep 16
1
findInterval
Suppose we have `dat` shown below and we want to find the the `y` value corresponding to the last value in `x` equal to the corresponding component of `seek` and we wish to return an output the same length as `seek` using `findInterval` to perform the search. This returns the correct result: dat <- data.frame(x = c(2, 2, 3, 4, 4, 4), y = c(37, 12, 19, 30, 6, 15), seek = 1:6)