similar to: Removal of columns from matrix where all values of the column are identical.

Displaying 20 results from an estimated 7000 matches similar to: "Removal of columns from matrix where all values of the column are identical."

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
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
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))
2011 Mar 30
5
save ordinary numerical calculations as pdf
I'd like to save some calculation outputs as a pdf, to incorporate with others in a document. I've tried pdf("filename") name_of_object_to_output dev.off() but it doesn't seem to work, appears that this pdf function is for graphics? Is there a way to output numerical objects to pdf? Thanks J Dr. Jim Maas University of East Anglia
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
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
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 <-
2010 Aug 24
3
multiple assignments ?
Simple one, have read and googled, still no luck! I want to create several empty vectors all of the same length. I would like multiple empty vectors (vec1, vec2, vec3) and want to create them all in one line. I've tried vec1,vec2,vec3 <- vector(length=5) and c(vec1,vec2,vec3) <- vector(length=5) and several other attempts but nothing seems to work ... suggestions? Thanks Jim
2010 Oct 20
2
create a list fails
I can not understand why this fails > > faicoutput2 <- list(stuff21 = as.numeric(faicout$coefficients[2]), + stuff31=as.numeric(faicout$coefficients[3]), + stuff41=as.numeric(faicout$coefficients[4]), + stuff32=(stuff21-stuff31), + stuff42=(stuff21-stuff41), +
2010 Aug 31
4
pasting together 2 character arrays
If possible I would like to combine two different character arrays in combinations Array1 <- c("height","weight","age","sex") Array2 <- c("trt0","trt1","trt2") I would like to combine these two character vectors to end up with such ... Array3 "height.trt0.trt1" "height.trt0.trt2"
2000 Feb 28
4
Multiple smbd processes generated
We have an occasional problem which manifests with multiple processes being created for a particular user. For example, for a user "xy004": xy004 8463 0.0 0.0 6.02M 0K ?? IW 11:48:59 0:02.02 smbd xy004 9426 0.0 0.0 5.99M 0K ?? IW 11:52:18 0:03.68 smbd xy004 10433 0.0 0.0 5.81M 0K ?? IW 12:17:20 0:00.85 smbd xy004
2011 May 09
2
Time Series
I have what I hope is a simple question - is it possible to do time series analysis on a small data set specifically only four data points? I have collected human threat data (mean number of threats per kilometre walked/ survey) every 3 months in eight different sites (four with an experimental element and four control sites). I am trying to determine the best way to determine if there is a
2011 Apr 10
2
howto calculate column means in data frame
Long story short, I have a big iterative procedure that produces a long list of data.frames such as the one called "results" here. Is there an easy way to produce a similar list of data.frames comprised of the mean of each of the columns in results, such that it ends up like the one I've shown in "resultsmean" below? I've tried apply and lapply, still not got the
2006 Oct 15
1
Execution halting of lmer on UNIX when no problem on windows
Dear R-users, I have a frustrating problem that I am hoping has a simple fix. I am running a series of lmer models from the lme4 package of the general form: model<-lmer(y~x1 + x2 ..... + xn + (1|site),data=dataframe,family=poisson,method="Laplace",control=list(usePQL=FALSE,msVerbose=TRUE)) where the same model is executed multiple times on a bootstrapped dataframe. For each
2006 Sep 04
1
Problem with Variance Components (and general glmm confusion)
Dear list, I am having some problems with extracting Variance Components from a random-effects model: I am running a simple random-effects model using lme: model<-lme(y~1,random=~1|groupA/groupB) which returns the output for the StdDev of the Random effects, and model AIC etc as expected. Until yesterday I was using R v. 2.0, and had no problem in calling the variance components of the
2010 Jan 07
1
faster GLS code
Dear helpers, I wrote a code which estimates a multi-equation model with generalized least squares (GLS). I can use GLS because I know the covariance matrix of the residuals a priori. However, it is a bit slow and I wonder if anybody would be able to point out a way to make it faster (it is part of a bigger code and needs to run several times). Any suggestion would be greatly appreciated. Carlo
2011 Feb 17
7
removing lower and upper quantiles from an arry
I'm trying to work out the simplest way to remove the upper and lower quantiles, in this case upper and lower 25% from an array. I can do it in two steps but when I try it in one, it fails. Is there something simple missing from my syntax or are there other simple elegant way to accomplish this? Thanks J > i <-1:20 > i2 <- i[i<quantile(i,.75)] > i3 <-
2011 Mar 14
7
creating character vector
Is there a way to convince R to create a character vector without using the quotes? This works ex1 <- c("first","second") but when I try this it doesn't ext <- as.character(c(first,second)) it complains. I have many variables to put into character vectors so dispensing with the quotes would be useful. Thanks Jim =============================== Dr. Jim Maas