search for: rs555

Displaying 3 results from an estimated 3 matches for "rs555".

2008 Jun 29
1
creating a dataframe using a list of the variable names
.../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 using the list of the variables, contain...
2008 Jul 08
2
attributing values to dataframe positions following eval
...verybody, 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 example) using: > eval(polyList[[...
2008 Jun 29
2
How to get an argument dynamically from a list?
...4/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(paste("data.raw$", polyList[2],...