similar to: Having some Trouble Data Structures

Displaying 20 results from an estimated 1000 matches similar to: "Having some Trouble Data Structures"

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
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))
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
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 Jan 29
3
NA and Character(0) in List Element
Hi, This is probably a small query but one I'm struggling with: I have a list in which I had elements which were NA, I removed them, by doing: list2 <- lapply(list, na.omit), However this leaves the element there with 'character(0)' in place as well as attributes: e.g. [[978]] character(0) attr(,"na.action") [1] 1 attr(,"class") [1] "omit" I want
2007 May 30
2
matrix in data.frame
Dear list! I have run into a problem that seems very simple but I can't find any solution to it (have searched the internet, help-files and "An introduction to R" etc without any luck). The problem is the following: I would like to create a data.frame with two components (columns), the first component being a matrix and the second component a vector. Whatever I have tried so far, I
2007 Jun 29
4
Dominant eigenvector displayed as third (Marco Visser)
Dear R users & Experts, This is just a curiousity, I was wondering why the dominant eigenvetor and eigenvalue of the following matrix is given as the third. I guess this could complicate automatic selection procedures. 0 0 0 0 0 5 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 Please
2010 Nov 02
2
multi-level cox ph with time-dependent covariates
Dear all, I would like to know if it is possible to fit in R a Cox ph model with time-dependent covariates and to account for hierarchical effects at the same time. Additionally, I'd like also to know if it would be possible to perform any feature selection on this model fit. I have a data set that is composed by multiple marker measurements (and hundreds of covariates) at different time
2004 Nov 09
2
Data Censoring and Normality Tests
Hello, I would like to know if there is a function in R that will test for normality and handle censored data sets. Currently, I evaluate each censored data set by the extent to which a normal scores plot approximate a straight line. For complete data sets I use shapiro.test(). Below is an example of a censored data set. data1<-c(0.00, 0.00, 0.00, 5.86, 5.17, 8.17, 5.12, 4.92, 7.08,
2012 Nov 06
1
sample from list
Hi all, I have a list of genes present in 500 individuals, the individuals are the elements: Genes <- lapply(1:nrow(inds),function(x) sample(1:10000,inds$No_of_Genes,replace=TRUE)) (This was later written to a dataframe as well as kept as the list object: inds2 <- data.frame(inds,Genes=I(Genes))) I also have a vector of how many of those genes are expressed in the individuals, this can
2004 May 27
2
Stats package
Hi The cor function in the stats package calculates the correlation between columns of data, does anyone know if it is at all possible to calculate the correlation between rows instead ? Or is there an appropriate package or function that is more appropriate I'd like to calculate spearman & pearson correlations between rows. Many thanks Jason -- --------------------------------
2013 Feb 05
1
Remove and add to many matrices in list.
Hi all, I realised that my last email question and code was probably going to be a bit of an eyesore for some people and that perhaps the best thing for me to do is to pose the question of what it is I want to achieve, rather than what I''ve written, if it helps people: I''m writing a simulation, and during that simulation I have a list of matrices – of variable number of
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 <-
2008 Dec 12
1
Support vector model?
Dear All, Apologies for sending this email to both list, but at this point I'm not sure which one could help me the most. I have 4 sets of data, 1 test and 3 different sets of controls. The measurements are binary, with a matrix of 0 and 1 I'm measuring across time (rows, ~815) the behaviour of organelles in the cell by microscopy in response to different stimuli (several measurements
1999 Jun 18
1
Stepwise model selection question
I use the step() function occasionally, and I think I understand its objective, proper use, and limitations. Now I see stepwise model selection being used in what seems to be an unusual way, and I wonder if it is right or wrong. May I describe? Genetic mapping tries to find where in an animal's genome are genetic elements that influence a particular physical trait. Say there are 100
2005 May 20
2
RSYNC with Double-byte
Hi All, Can anyone suggest how to make rsync work in order to replicate double-byte characters ? Thanks to anyone who can help aslay
2007 Dec 19
1
FW: cgh package
Hi, I would like some extra information on the 'cgh' package in R. I noticed that there isn't much activity regarding this package on the R and BioC mailing list (I googled it). I started using this package and I have few questions: 1/ As I have a custom tiling like array @8um features resolution (affy), I have a lot of probes to work with. I'm assuming it is correct to
2010 May 20
1
computer out of memory when using sigpathway
Dear R users, I am sorry to disturb you! But I really need your help for the usage of sigPathwy. Actually, I want a sliding window analysis for possible chromosome expression pattern mining. My research microorganism is a plant pathogen, Gibberella zeae, and I first used SAS to divide locus number with 10, 20, 30, or 40 on the fungal chromosome according to their location. I really
2006 Sep 11
3
Extracting overdispersion estimates from lmer amd glm objects
Dear list, I am needing to extract the estimate of overdispersion (deviance / residual degrees of freedom or c-hat) from multiple model objects - so they can then be used to compare the extent of overdispersion among alternative models as well as calculate qausi-AIC values. I have been unable to do this, despite consulting a number of manuals and searching the R-help. I am imaging that in