Displaying 4 results from an estimated 4 matches for "rs123".
Did you mean:
s123
2010 Feb 28
1
Combining 2 columns into 1 column many times in a very large dataset
...and 3) but not my question 1).
However, I include 2) and 3) in case anyone has recommendations that would
be efficient.
Here is a toy example of the data structure:
pop = data.frame(status = rbinom(n, 1, .42), sex = rbinom(n, 1, .5),
age = round(rnorm(n, mean=40, 10)), disType = rbinom(n, 1, .2),
rs123=c(1,3,1,3,3,1,1,1,3,1), rs123.1=rep(1, n),
rs157=c(2,4,2,2,2,4,4,4,2,2),
rs157.1=c(4,4,4,2,4,4,4,4,2,2), rs132=c(4,4,4,4,4,4,4,4,2,2),
rs132.1=c(4,4,4,4,4,4,4,4,4,4))
Thus, there are a few columns of basic demographic info and then the rest of
the columns are biallelic SNP info. Ex: rs123 is all...
2008 Jul 08
2
attributing values to dataframe positions following eval
Hi everybody,
I've been looking around, but can't seem to find the answer.
I get a list of names (which vary, so I never know them in advance), and
transform them into variables, each of which is a dataframe, using
assign:
polyList <- c("rs123", "rs124", "rs555", "rs000")
numPoly <- length(polyList)
for (k in 1:numPoly) {
assign(polyList[k], data.frame(matrix(NA, ncol=3, nrow=3)))
}
polyList <- lapply(polyList, as.name)
I can see the resulting dataframe associated to rs123 (for ex...
2008 Jun 29
1
creating a dataframe using a list of the variable names
...'A/A', 'C/A', '154/35')
CLIFF <- c('A/C', 'C/C', '15/12')
PAM <- c('A/C', 'C/A', '13/12')
sampleList <- c("BOB", "MARY", "JOHN", "CLIFF", "PAM")
polyList <- c("rs123", "rs124", "rs555")
to create a dataframe with the data I use:
data.raw <- data.frame(BOB, MARY, JOHN, CLIFF, PAM, row.names=polyList)
which works fine, but when there are several hundreds samples... well, you guess my problem.
I'd like to create the dataframe us...
2008 Jun 29
2
How to get an argument dynamically from a list?
...('A/A', 'C/A', '154/35')
CLIFF <- c('A/C', 'C/C', '15/12')
PAM <- c('A/C', 'C/A', '13/12')
sampleList <- c("BOB", "MARY", "JOHN", "CLIFF", "PAM")
polyList <- c("rs123", "rs124", "rs555")
#make dataframe with data
data.raw <- data.frame(t(do.call(data.frame, lapply(sampleList, get))))
names(data.raw) <- polyList
row.names(data.raw) <- sampleList
I want to get, for example, data.raw$rs124 using polyList.
I tried
> get(past...