search for: sainsburi

Displaying 8 results from an estimated 8 matches for "sainsburi".

Did you mean: sainsbury
2013 Jan 25
3
Removal of columns from matrix where all values of the column are identical.
Hi all, I'd like to write a piece of code which will remove columns from a matrix, if the column contains only one value, say every value in the column is a "3": Matrix <- matrix(NA, nrow=5, ncol=4) Matrix[,1] <- c(1,2,3,4,5) Matrix[,2] <- c(3,3,3,3,3) Matrix[,3] <- c(5,4,3,2,1) Matrix[,4] <- c(5,1,4,3,2) [,1] [,2] [,3] [,4] [1,] 1 3 5 5 [2,] 2
2013 Jan 24
1
Pairwise Comparrisons
Dear all, I''m trying to write a function, that will take as an argument, some aligned genome sequences, and using a sliding window, do pairwise comparisons of sequence similarity. Coding the sliding window I think I can manage but what I''m trying to get to grips with is getting it so as every pairwise comparison is made, no matter how many genomes are added, from 3 to N. So if
2013 Feb 04
0
Subscript out of Bounds Lapply
Hi all, I've written a function for a simulation which will - in general operation without being specific to the simulation scenario, duplicate or delete columns from a matrix based on two values which determine how many as a proportion of the matrix: the two values are always between 0.01 and 0.99: Dup.Dels <- function(matrix, values){ p.dup <-
2012 Oct 28
6
Having some Trouble Data Structures
Hi All, I'm trying to run a simulation of host-pathogen evolution based around individuals. What I need to have is a dataframe or table of some description - describing all the individuals of a pathogen population (so far I've implemented this as a matrix): ID No_of_Effectors Effectors (Sequences) [1,] 0001 3 ## 3
2012 Nov 27
2
Stuck trying to modify a function
Hi, I have the following data: Path_Number <- 5 ID.Path <- c(1:Path_Number) # Make vector of ID's. No_of_X <- sample(50:550, length(ID.Path), replace=TRUE) # X <- split(sample(1:10000, sum(No_of_X), replace=TRUE), rep(ID.Path, No_of_X)) Y <- lapply(X,function(x) sample(x, round(runif(1, min=10, max=50)))) X and Y are both lists, and I've made the following function to
2012 Nov 08
1
Extract cell of many values from dataframe cells and sample from them.
Hi, First my apologies for a non-working piece of code in a previous submission, I have corrected this error. I'm doing is individual based modelling of a pathogen and it's host. The way I've thought of doing this is with two dataframes, one of the pathogen and it's genes and effector genes, and one of the host and it's resistance genes. During the simulation, these things
2013 Feb 14
0
Building a Package & using gWidgets
Hi, For the past few months I've been building a simulation in R I hope to package. It consists of two usable functions, and many internal ones which one of the two usable functions call while looping, to perform the stages of simulation. A simple conceptual example is: # Abstract representation 1st Usable function, generates object containing settings for simulation. settings <-
2012 Nov 16
1
Code works, but not as function.
Hi, I have some values in a list format generated by the following: Path_Number <- 0010 ID.Path <- formatC(0001:Path_Number, width=4, flag=0) # Make vector of ID's. No_of_Effectors <- sample(1:550, length(ID.Path), replace=TRUE) # Define Number of Effectors each individual gets. Effectors <- split(sample(1:10000, sum(No_of_Effectors), replace=TRUE), rep(ID.Path, No_of_Effectors))