Hi, I believe you are looking for ?unlist. Here is something that does what I think you want with data that is my best guess at what yours is like (if the data in seed_panel is stored as factor, you will probably need to convert it first somehow).
> seed_panel <- data.frame(V2 = "507D22", V3 = "518F15", stringsAsFactors = > FALSE) > Control <- matrix(1:4, ncol = 2, dimnames = list(c("505E01", "etc"), > c("Col1", "Col2"))) > > unlist(c(seed_panel[1, ], rownames(Control)[1])) V2 V3 "507D22" "518F15" "505E01" As a future suggestion, doing something like dput(head(your_data_name)) is a simple way to provide us with the first few rows of your data. Cheers, Josh On Tue, Aug 17, 2010 at 10:36 AM, Gil Gamesh <games...@gmail.com> wrote: > Apologies, I neglected to check that the email was plain text. Here is > a the text of the previous email. > > > Hello, > > I am trying to iteratively build a build a panel of variables to > discriminate between two groups. > > My starting position is a matrix of experimental data and I have a function > that will work through all pairs of variables and produce sensitivities, > specificities and p-values for each pair and write it to a file (above > particular cut-offs). > > I have a second function that will read that file in and use the pairs as a > 'seed' adding a third variable from the original matrix and performing the > same calculations and writing a new file. > > My aim is to iterate through this procedure five or six times. > > My difficulty is making the index vector to extract the values I need from > the matrix of experimental data. > > The seed panel is a row in a data.frame: > > print(seed_panel[i,]) > > V2 V3 > 1 507D22 518F15 > > > and the variable to add to it is a rowname of the experimental matrix: > > print(rownames(Control[j,])) > > [1] "505E01" > > I haven't found a way to combine these three - I would like a vector > c("507D22","518F15","505E01") - to subscript the matrix of experimental > data. > > IndexList <- c(as.vector( seed_panel[ i, ], mode="any"), rownames( Control[ > j, ] ) ) > > Gives: > > $V2 > [1] 507D22 > 18 Levels: 507D22 518F15 522C17 522K21 523A19 528H06 528P11 530H18 ... > 585K18 > > $V3 > [1] 518F15 > 20 Levels: 518F15 522C17 522K21 523A19 528H06 528P11 530H18 534L09 ... > 590C18 > > [[3]] > [1] "505E01" > > and I haven't had any luck with variations on this that I've tried. > > > Many thanks in advance for any help. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.