similar to: Removing elements from a vector matching a criteria, BUG in which() function

Displaying 20 results from an estimated 10000 matches similar to: "Removing elements from a vector matching a criteria, BUG in which() function"

2010 Feb 22
1
matching on two criteria
Howdy y'all, I am looking to use the match function to match a data attribute to another data frame but i need it to do so on two criteria to ensure an appropriate match. The following matches incorrectly. I know the example looks pointless but its just an example. Perhaps there is another way of doing this? Thanks #Sample Data Props<-c("p754921","p754921"
2009 Jan 23
1
Relative frequency of cases in data frame matching a specified criteria
I want to get the relative frequency of cases in a data frame that matches a specified criteria, omiting NA values. This seem so simple, but I can't come up with an effective way. nrow(data[data$variable>value & !is.na(data$variable),])/nrow(data) works but is very ineffective and CPU consuming when the data frame is large (more than 13000 rows and 400 columns). /S
2013 Jan 25
5
Loop question?
Dear All   I have the following data (somewhat simplyfied):   TINF <-1 a <-c(500,750,1000,1250,1500,1750,2000) b <-c(8,12,18,24,36,48,60,72,96)   following function:   infcprodessa <-function (D, tin, tau, ts)   (D * (1 - exp(-0.048 * tin))/(tin * (0.048*79) * (1 - exp(-0.048 * tau)))) * exp(-0.048 * (ts - tin)) z <-sapply(1:1, function(n) infcprodessa(1000,TINF,12,12-TINF))   is
2010 Sep 17
1
How to find STRESS criteria in MDS when there are negative eigenvalues....
Hi, I want to know whether there is any function in R to find STRESS after using cmdscale and estimating the coordinates, I have written these functions to find stress (for p =1,2,3,4,5) stress<-rep(0,5) for(p in 1:5) { datahat<-cmdscale(d,p) deltahat<-as.matrix(dist(datahat)) a<-0 b<-0 for(i in 1:n) { for(j in 1:n) { a<-d[i,j]^2+a b<-(d[i,j]-deltahat[i,j])^2+b } }
2009 May 10
1
Select the rows in a dataframe that matches a criteria in another dataframe
Hi everyone! Thank you for the help you have been given to me, and here I'm with another problem with my dataframes: I have two dataframes (with much more observations), like these: Dataframe1 Firm Year cash 500400200 2007 100 500400200 2006 200 500400200 2005 400 500400300 2007 300 500400300 2006 240 500400300 2005 120 500400400
2010 Dec 01
3
How to pass selection criteria in a function
Hi, Suppose I have the following data name     score Abel        88 Baker      54 Charlie    77 stored a  table called myData. I want to write a function that will create a table which is a subset of myData containing those have a score > 75. I know I can do this with the following command: subset(myData, score > 75) But I would like to do this via a function, something like:
2013 Oct 03
1
ixgbe/ix sysctl missing in FreeBSD 9.2
Hello everyone, I am trying to tweak some of the sysctl tunables for the ix (ixgbe) driver in FreeBSD 9.2 since I am experiencing less than ideal performance and it seems like I can't find any: # sysctl -a | grep -i ixgbe device ixgbe I am running 9.2-RC4. Any input appreciated. Thanks, -- Rumen Telbizov Unix Systems Administrator <http://telbizov.com>
2011 Oct 09
2
Substract "previous" element
Dear all, I have a matrix with data and I want to substract from every value the previous element. Let's assume that my vector(matrix) is c<-(1,2,3,4,5) I want to get remove_previous c<-(0,1,2,3,4). How I can do that efficiently in R? I would like to thank you in advance for your help B.R Alex [[alternative HTML version deleted]]
2012 Nov 24
2
Performing operations only on selected data
I spent some time on this simple question, also searched the forum, eventually hacked my way to an ugly solution for my particular problem but I would like to improve my coding: I have data of the form: df <- expand.grid(group=c('copper', 'zinc', 'aluminum', 'nickel'), condition1=c(1:4)) I would like to add a new data column "condition2", with values
2020 May 21
3
RFC: Release qualification criteria
Hi, I'm splitting this discussion off of my RFC for release process changes. We currently have no official release qualification criteria. In other words, we don't have any blocking tests that need to pass in order to make a new release. We do time-based releases, which is not always compatible with having quality-based criteria for tagging a final release. So, I think another way to
2008 Nov 20
2
[LLVMdev] Validation Criteria
As we begin designing the proposed validation process, we should think about what the criteria for a successful validation should be. In the initial proposal I suggested the "make check" on llvm should pass as should the tests in llvm-test. According to Tanya, not all of llvm-test passes. Do we have a sense of how far away from a full passing llvm-test we are? I also know that a
2012 May 17
2
New Subsystem criteria for Match option block in OpenSSH server
Hello everybody, I'm a C/C++ consultant working for Ericsson. I changed the OpenSSH-Portable code to add a new criteria into the Match sshd_config option read by the sshd server. The new criteria is "Subsystem"; so a conditional block based on subsystem client request can now be added to the sshd_config configuration server file to override settings in its global section.
2012 Mar 22
2
Randomly select elements based on criteria
Hi, I want to randomly pick 2 fish born the same day but I need those individuals to be from different families. My table includes 1787 fish distributed in 948 families. An example of a subset of fish born in one specific day would look like: >fish fam born spawn 25 46 43 25 46 56 26 46 50 43 46 43 131 46 43 133 46 64 136 46 43 136 46 42 136 46 50 136 46 85 137 46 64 142 46 85 144 46 56
2012 Sep 27
2
Is there a function that runs AR model with Schwarz Bayesian Information Criteria (BIC)?
Hello, Is there a function in R by which one can run AR model with Bayesian Information Criteria (BIC)? To my knowledge, functions ar and ar.ols could select the order only by AIC. Thanks, Miao [[alternative HTML version deleted]]
2007 Sep 17
1
Stepwise logistic model selection using Cp and BIC criteria
Hi, Is there any package for logistic model selection using BIC and Mallow's Cp statistic? If not, then kindly suggest me some ways to deal with these problems. Thanks. -- View this message in context: http://www.nabble.com/Stepwise-logistic-model-selection-using-Cp-and-BIC-criteria-tf4464430.html#a12729613 Sent from the R help mailing list archive at Nabble.com.
2013 May 01
1
selecting rows based on multiple criteria
Dear List, I am struggling with the following problem. Suppose I have the following data.frame: coord<-expand.grid(x=1:10,y=1:10) and I want to extract the row numbers of those matching the criteria defined by the following data.frame: choice<-data.frame(x=c(2,1,2),y=c(1,2,2)) the result should return in this case: 2,11,12 All I managed to do is the following: which(data
2011 Jun 24
2
counting columns that fulfill specific criteria
Hi, I have a matrix (pwdiff in the example below) with ~480000 rows and 780 columns. For each row, I want to get the percentage of columns that have an absolute value above a certain threshold "t". I then want to allocate that percentage to matrix 'perc' in the corresponding row. Below is my attempt at doing this, but it does not work: I get 'replacement has length
2012 Mar 01
5
select rows by criteria
Hello, I am stuck with selecting the right rows from a data frame. I think the problem is rather how to select them then how to implement the R code. Consider the following data frame: df <- data.frame(ID = c(1,2,3,4,5,6,7,8,9,10), value = c(34,12,23,25,34,42,48,29,30,27)) What I want to achieve is to select 7 rows (values) so that the mean value of those rows are closest to the value of 35
2010 Oct 22
1
Problem with Aggregate - Sum, limit on number of criteria
Hello, It appears there is a limit in the number of criteria that can be put into the Aggregate sum function. (It looks like it is 32). My code is; HSfirst=aggregate(count,
2009 Aug 21
1
Appending elements according to criteria to an empty array
Hi all R users, I am trying to extract elements from an array (x as shown below) where the difference between the consecutive elements does not equal 1. The desired output is: j = 6,17,27,38,58,69,79,90 However, the code below only returns: j = 1,69,79,90 I am assuming that "cbind" function is not extracting all the elements meeting the condition. In