Displaying 2 results from an estimated 2 matches for "no_expressed_genes".
2012 Nov 06
1
sample from list
..._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 also kept as a vector object or written to a data frame:
inds2$No_Expressed_Genes <- round(as.numeric(lapply(1:nrow(inds2),function(x) runif(1, min=10, max=50))))
I want to create another list which consists of each individuals expressed genes - essentially a subset of the total genes the individuals have in the "Genes" list, by sampling from the Genes list for eac...
2012 Nov 08
1
Extract cell of many values from dataframe cells and sample from them.
...),",")
If I use code that you provided in your earlier e-mail to create inds2, I get errors because inds doesn't have a variable No_of_Genes.
Genes <- lapply(1:nrow(inds),function(x) sample(1:10000,inds$No_of_Genes,replace=TRUE))
inds2 <- data.frame(inds, Genes=I(Genes))
inds2$No_Expressed_Genes <- round(as.numeric(lapply(1:nrow(inds2),function(x) runif(1, min=10, max=50))))
So, before you hit the send button on your next e-mail. Start a clean R session with none of your objects in the working directory or the search path, and test your code to see if it runs.
You will find many more...