similar to: Extract cell of many values from dataframe cells and sample from them.

Displaying 20 results from an estimated 100 matches similar to: "Extract cell of many values from dataframe cells and sample from them."

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 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
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
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
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")
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
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
2012 Jan 03
0
Job opportunity in AMSTERDAM: ANALYSIS OF NGS CANCER DATA
COMPUTATIONAL ANALYSIS OF NEXT GENERATION SEQUENCE DATA (http://bioinformatics.nki.nl/vacancies.php) THREE BIOINFORMATICS POSITIONS PROJECT OUTLINE Genomic alterations are major determinant of responses to (targeted) therapies in cancer. In fact, the best positive and negative predictors of responses to targeted therapies are alterations in kinases or their direct downstream effectors. To
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
1999 Dec 09
1
tsboot
Fritz, I have slightly adapted (didn't work before) "tsboot" from the "boot" library to the current time series conventions of R. The following patch will do that. I suggest to apply this patch to the file "boot/R/bootfuns.q" of the "boot" library at CRAN. best Adrian --- bootfuns.orig.q Thu Dec 9 10:07:23 1999 +++ bootfuns.q Thu Dec 9 10:06:51 1999
1999 Dec 09
1
tsboot
Fritz, I have slightly adapted (didn't work before) "tsboot" from the "boot" library to the current time series conventions of R. The following patch will do that. I suggest to apply this patch to the file "boot/R/bootfuns.q" of the "boot" library at CRAN. best Adrian --- bootfuns.orig.q Thu Dec 9 10:07:23 1999 +++ bootfuns.q Thu Dec 9 10:06:51 1999
2005 Dec 19
0
Package "boot": How to construct CI from censboot object?
Dear all, I run the example of "censboot" contained in "boot" package. But, I can't find the confidence interval of the resulted "censboot" object. Any idea ? > aml.fun <- function(data) { + surv <- survfit(Surv(time, cens)~group, data=data) + out <- NULL + st <- 1 + for (s in 1:length(surv$strata)) { +