search for: quagaars

Displaying 4 results from an estimated 4 matches for "quagaars".

2011 Jul 05
4
Create a data frame of all possible unique combinations of factors
Hello, I'm trying to create a data frame where each row has a unique combination of factors. I start with a vector of species like so: > 1> test <- c("A","B","C","D") > > 1> test > > [1] "A" "B" "C" "D" > To get all species combinations I have used expand.grid like this:
2010 May 18
1
Dealing with 1000+ sequentially named vectors
Hello! I'm having trouble figuring out how to apply a function to a set of vectors or data frames, when that set is over 1000 large. I've created 1891 vectors named as follows: vector.names <- paste("vector",1:1891,sep="") These can be referred to easily by using get as follows: vector <- get(vector.names[1]) The problem is, I can't figure out a
2010 May 12
3
summing items within a row
Hello, I am trying to figure out how to do a sum of items within a row. For example, I have a data frame something like this: A1 B1 ... A2 B2 ... 1 1 4 1 4 2 2 5 2 5 3 3 6 3 6 What I want, is for each row, to get A1 + A2, B1 + B2, etc. which would, perhaps, give me a vector something like this c(2, 8, ... 4, 10 ... 6, 12). Does anyone know of a simple
2011 Jul 21
2
Find pattern in matrix
Hello all, I'm trying to find all combinations of 4 numbers that satisfy 4 criteria, inside of a matrix (62 x 25). I've found a way to do this using for loops, but it is extremely slow because it involves checking every possible combination of numbers (567300) to see if the criteria are satisfied. Do you think there is a faster method of doing this? Or some functions that might help me