similar to: Selecting rows according to a column

Displaying 20 results from an estimated 70000 matches similar to: "Selecting rows according to a column"

2005 Feb 23
3
filling columns in frame according to another column frame
R-help, I have a frame which I want to fill up conditioning to another data frame column. The one I want to fill up is as follows (basically an empty one): > test2 cm 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3
2007 Mar 13
4
selecting rows with more than x occurrences in a given column (data type is names)
Despite a long search on the archives, I couldn't find how to do this. Thanks in advance for what is likely a simple issue. I have a data set where the first column is name (i.e., 'Joe Smith', 'Jane Doe', etc). The following columns are data associated with that person. I have many people with multiple rows. What I want is to get a new data frame out with only the people who
2012 May 16
2
Help needed for efficient way to loop through rows and columns
Dear R-helpers: I am trying to write a script that iterates through a dataframe that looks like this: Example dataset called "sample": names <- c("S1", "S2", "S3", "S4") X <- c("BB", "AB", "AB", "AA") Y <- c("BB", "BB", "AB", "AA") Z <- c("BB",
2012 Aug 03
4
How to concatenate a several rows according with a column ?
Hi, I'm a new user or R and I try to concatenate a several rows according with the value in a column. this is my data.frame and I want to concatenate my data.frame according with the column "b" and make a new data.frame with the information in the others columns. >table1 a b c d 1 E001234 TSA IP234 like_domain 2
2006 Mar 17
3
Binning question (binning rows of a data.frame according to a variable)
Hi, I have tuples of data in rows of a data.frame, each column is a variable for the 'items' (one per row). One of the variables is the 'size' of the item (row). I would like to cut my data.frame into groups such that each group has the same *total size*. So, assuming that we order by size, some groups should have several small items while other groups have a few large
2012 Sep 26
5
create new column in a DF according to values from another column
Hi everyone, I have a small problem in my R-code. Imagine this DF for example: DF <- data.frame(number=c(1,4,7,3,11,16,14,17,20,19),data=c(1:10)) I would like to add a new column "Station" in this DF. This new column must be automatically filled with: "V1" or "V2" or "V3". The choice must be done on the numbers (1st column). For example, I would like
2011 Aug 15
1
Selecting section of matrix
Hi, I have a question concerning the selection of data. Let's say that given list h created below, I would like to select a section of the 1999 matrix. For a case (rownames and colnames) I would like to select the cells that have a value > 0. So for case 8025 8025 8026 8027 8025 1 1 1 8026 1 1 1 8027 1 1 1 And for case 8028 8028 8029 8028 1
2005 Nov 13
1
selection of missing data
Hi i'm a french medical student, i have some data that i import from excel. My colomn of the datafram are the localisations of metastasis. If there is a metatsasis there is the symbol "_". i want to exclude the row without metastasis wich represent the NA data. so, i wrote this mela is the data fram mela1=ifelse(mela[,c(11:12,14:21,23,24)]=="_",1,0) # selection of the
2008 Sep 17
3
selecting dataframe values that are not nulls
Hi, I have a dataframe with 14319rows and 9 colums. for some rows there are null values.I want a dataframe without these null values.I wanna select only those that have values !=NA. kindly let me know how to do that. Ramya -- View this message in context: http://www.nabble.com/selecting-dataframe-values-that-are-not-nulls-tp19537093p19537093.html Sent from the R help mailing list archive at
2007 Feb 28
2
delete selecting rows and columns
Hi, I'm working with a big square matrix (15k x 15k) and I have some trouble. I want to delete selecting rows and columns. I'm using something like this: > sel_r=c(15,34,384,985,4302,6213) > sel_c=c(3,151,324,3384,7985,14302) > matrix=matrix[-sel_r,-sel_c] but it works very slow. Does anybody know how to make it in faster way? Thank's -- View this message in context:
2006 Mar 01
3
Optimization problem: selecting independent rows to maximize the mean
Dear R community, I have a dataframe with 500,000 rows and 102 columns. The rows represent spatial polygons, some of which overlap others (i.e., not all rows are independent of each other). Given a particular row, the first column contains a unique "RowID". The second column contains the "Variable" of interest. The remaining 100 columns ("Overlap1" ...
2010 Apr 10
2
selecting certain columns or rows from a .csv
Hello, I'm using <read.csv("filename",header=TRUE) but need to extract just certain columns or rows from the file. Much thanks. -- View this message in context: http://n4.nabble.com/selecting-certain-columns-or-rows-from-a-csv-tp1835692p1835692.html Sent from the R help mailing list archive at Nabble.com.
2007 Mar 25
1
for loop help
Hello- I have a script which steps through a series of subjects, and for the subjects I remove outlying values. After removing these outliers, I specify a cutoff, keeping only values over a certain value (e.g., 1.96). I want to populate a matrix with a statistic of the values that make the cutoff (for example, the mean). However, in some subjects, after outliers and the cutoff are specified,
2012 Jul 13
3
Column create and Update using function
Hi, here i have a Max and Min values Min <-3 Max <-6 and also a matrix like this, ABC XYZ PQR ------ ------- ------- 2 4 3 5 4 8 7 1 3 In this i need to check each particular column values are between Max and Min value. If the coulmn value not coming between Max and
2011 Aug 03
1
Extract rows from a matrix according to value in column
Dear helpers, I'm trying to extract certain rows from a matrix according to the values the rows have in a certain column. I've been googling for a while without result. Here's a reproducible example of a matrix (and the one I was playing with initially): > myrepo<-getOption("repos") >
2011 Sep 26
2
Randomly selecting rows with unique values in two columns
Hello, I am trying to randomly select rows with unique values in columns 1 and 2. I want to generate multiple subsets to estimate a statistic for each data set. Below is a simplified example. L1 L2 L3 L4 L5 1 a b 1 2 3 2 a c 4 5 6 3 a d 7 8 9 4 a e 10 11 12 5 a f 13 14 15 6 b c 16 17 18 7 b d 19 20 21 8 b e 22 23 24 9 b f 25 26 27 10 c d 28 29 30 11 c e
2011 Aug 22
1
Selecting cases from matrices stored in lists
Hi, I have two lists (c and h - see below) containing matrices with similar cases but different values. I want to split these matrices into multiple matrices based on the values in h. So, I did the following: years<-c(1997:1999) for (t in 1:length(years)) { year=as.character(years[t]) h[[year]]<-sapply(colnames(h[[year]]), function(var)
2010 Mar 05
2
Selecting rows of a matrix based on some condition on the columns
The data set consists of two sets of matrices, as labelled by the columns, T's and C's. > xy x T1 T2 T3 T4 T5 C1 C2 C3 C4 C5 [1,] 50 0.00 0.00 33.75 0.00 0.00 0.00 36.76 0.00 35.26 0.00 [2,] 13 34.41 0.00 0.00 36.64 32.86 34.11 35.80 37.74 0.00 0.00 [3,] 14 35.85 0.00 33.88 36.68 34.88 34.58 0.00 32.75 37.45 0.00 [4,] 33 34.56
2007 Aug 03
4
FW: Selecting undefined column of a data frame (was [BioC] read.phenoData vs read.AnnotatedDataFrame)
Hi all, What are current methods people use in R to identify mis-spelled column names when selecting columns from a data frame? Alice Johnson recently tackled this issue (see [BioC] posting below). Due to a mis-spelled column name ("FileName" instead of "Filename") which produced no warning, Alice spent a fair amount of time tracking down this bug. With my fumbling fingers
2010 Oct 04
1
Splitting a DF into rows according to a column
Hi, I'm turning my wheels on this and keep coming around to the same wrong solution - please have a look and give a hand ... The premise is: a DF like so > loremIpsum <- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque leo ipsum, ultricies scelerisque volutpat non, volutpat et nulla. Curabitur consequat ullamcorper tellus id imperdiet. Duis semper malesuada