Displaying 20 results from an estimated 1000 matches similar to: "sample from list"
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
2006 May 26
2
combinatorial programming problem
Hola!
I am programming a class (S3) "symarray" for
storing the results of functions symmetric in its
k arguments. Intended use is for association indices
for more than two variables, for instance coresistivity
against antibiotics.
There is one programming problem I haven't solved, making an inverse
of the index function indx() --- se code below. It could for instance
return the
2004 Feb 02
2
Nearest Neighbor Algorithm in R -- again.
Several of the methods I use for analyzing large data sets, such as
WinGamma: determining the level of noise in data
Relief-F: estimating the influence of variables
depend on finding the k nearest neighbors of a point in a data frame or
matrix efficiently. (For large data sets it is not feasible to compute
the 'dist' matrix anyway.)
Seeing the proposed solution to "[R] distance
2006 Apr 11
1
pattern in history
Hi,
Sometimes I need to consult the history of commands that are matching a
regex, so I modified the utils::history function for that purpose. I
found it useful.
I append the code ( I only added the two lines with #**)
Romain.
history2 <-
function (pattern="", max.show = 25, reverse = FALSE, unique =
pattern!="", ...)
{
file1 <- tempfile("Rrawhist")
2007 Aug 16
2
Possible memory leak with R v.2.5.0
I'm working with a very large matrix ( 22k rows x 2k cols) of RNA
expression data with R v.2.5.0 on a RedHat Enterprise machine, x86_64
architecture.
The relevant code is below, but I call a function that takes a cluster
of this data ( a list structure that contains a $rows elt which lists
the rows (genes ) in the cluster by ID, but not the actual data itself
).
The
2009 Nov 10
2
gsub does not support \b?
Hello, can someone help? How come
> gsub("\bINDS\b","INDUSTRIES","ADVANCED ENERGY INDS")
[1] "ADVANCED ENERGY INDS"
not ADVANCED ENERGY INDUSTRIES
Thanks.
Richard
[[alternative HTML version deleted]]
2002 Apr 30
1
followup -- deficiencies in readline capability
Why would R lack history capability?
Someone in a private electronic mail message suggested the possibility
that I was running R in a non-writable directory. This is not the
case, as the following logfile shows (where "$ " is my shell prompt):
$ ls -ld `pwd`
drwxrwxrwx 15 sys sys 2560 Apr 30 08:10 /tmp
$ R --vanilla
R : Copyright 2002, The R Development Core Team
2010 Oct 08
3
Efficiency Question - Nested lapply or nested for loop
My data looks like this:
> data
name G_hat_0_0 G_hat_1_0 G_hat_2_0 G_0 G_hat_0_1 G_hat_1_1 G_hat_2_1 G_1
1 rs0 0.488000 0.448625 0.063375 1 0.480875 0.454500 0.064625 1
2 rs1 0.002375 0.955375 0.042250 1 0.000000 0.062875 0.937125 2
3 rs2 0.050375 0.835875 0.113750 1 0.877250 0.115875 0.006875 0
4 rs3 0.000000 0.074750 0.925250 2 0.897750 0.102000
2010 Dec 02
2
Hmisc label function applied to data frame
Hello,
I'm attempting to create a data frame with correlations between every pair
of variables in a data frame, so that I can then sort by the value of the
correlation coefficient and see which pairs of variables are most strongly
correlated.
The sm2vec function in the corpcor library works very nicely as shown here:
library(Hmisc)
library(corpcor)
# Create example data
x1 = runif(50)
x2 =
2011 Jan 04
3
Writing do and resample functions
Hi,
I'm trying to take a function from a workspace download provided in a
stats textbook book, so I have it in my workspace to use all the time.
I opened the workspace and typed the names of the two functions to get
the code that makes them up:
-------------------------------------------------------------------------------------
> resample
function(d, size,
2009 May 30
1
arithmetic problem
Hello list
I have a problem with a dataset (see toy example below) where I am trying to find the difference between two (or more numbers) and discard those observations which fall outside a set interval.
An example and further explanation:
values ind
1 2655 7A5
2 3028 7A5
3 689 ABBA-1
4 1336 ABBA-1
5 1560 ABBA-1
6 2820 ABLIM1
7 3339 ABLIM1
8
2008 Jul 09
1
netCDF to TIFF
Greetings R users!
I am working with the ENSEMBLE climate data (10 min resolution daily
temperatures images for all of Europe 1950-2006). The data comes
packaged in a single netCDF file. I would like to read the data in and
export a subset (2002-2006) as geotiffs (one image per day). So far, I
can successfully read in the data and view the images within an R
display window. However, I have yet to
2001 Jul 10
1
gls function, very old results
Hello R-users,
I am currently trying to learn how to use the function gls of the nlme
library. I fitted the following model:
Generalized least squares fit by REML
Model: response ~ array + dye + genes + variety + variety * genes +
array * genes + dye * genes
Data: data
I have 11 arrays, 2 dyes, 2 varieties, 3200 genes, and 2 replications
for each.
Therefore I should have the corresponding
2004 Jul 21
2
Cutting heatmap dendrogram
Hello,
I've been clustering my data using hclust and cutting the resulting tree
with cutree. Separately, I visualize the clusterings with heatmap. Is it
possible to have the dendrogram on the heatmap reflect the cutree results?
That is, instead of having one large dendrogram, it would have 4 or 25 in
the example below. Any guidance on if that's possible or not, and what
kinds of
2008 Oct 30
3
why does sample(x, n) give the same n items in every separate runs?
Hello R users,
I have gene expression data of two groups of genes (large and small). Gene expression intensities of those genes are classified into 1 to 10 levels. What I want is to make a random set of genes that have the same levels as the small group from large group using sample().
I used smallvec to hold the number of genes in each levels (1 to 10) for small group, largevec for large group.
2011 Feb 09
1
samr - extract genes from siggenes.table
Hi BioC user,
I have a problem extracting the gene set I would like to work with.
Here is I work with my data:
normData <- read.delim("normalizedData.txt",sep ="\t")
######### two class unpaired comparison
# y must take values 1,2
classes <- c(-1,-2,1,2)
#prepere the data for the samr analysis
data.x <-as.matrix(normData[,8:11])
d=list(x=data.x,y=classes,
2016 Apr 05
2
Is that an efficient way to find the overlapped , upstream and downstream ranges for a bunch of ranges
I do have a bunch of genes ( nearly ~50000) from the whole genome, which read in genomic ranges
A range(gene) can be seem as an observation has three columns chromosome, start and end, like that
seqnames start end width strand
gene1 chr1 1 5 5 +
gene2 chr1 10 15 6 +
gene3 chr1 12 17 6 +
gene4 chr1 20 25 6 +
gene5
2009 Jun 15
2
NA as a result of using GLM
Hi all!
Maybe someone could help me with the following. I know this hasn't directly to do with ecology but I'm also using glm.
I have a list of 16 genes and 10 samples. The samples are of two types, 4 Ctrl and 6 Diseased. If,
labelInd<-as.factor(c(rep("0",4),rep("1",6)))
genes.glm<-glm(labelInd ~ ., family=binomial, data=mat)
beeing "mat" the 10x16
2010 Oct 04
1
Fisher exact test?
Hi All,
My apologies if this is a totally newbie question.
I want to calculate the probability that a particular set of genes is picked
repeatedly for 3 samplings. For example, if from a total of 'N' genes, I pick
'A' number of genes in the first pick, 'B' number of genes in the second pick,
and 'C' number of genes in the third pick, I would want to calculate
2013 Feb 01
2
help on proportions
Hi:
Apologies for asking the following question. As?this may sound very basic and stupid for this forum?, I honestly do not know how to solve it and I do not have a teacher who can help me understand.
?
I have list of genes (200)?that are involved in a particular process and I call this as a?ProcSet.?? From an independent experiment I found that out of 10,000 genes, 1500 are significant and I