Re: [R] matrix/df help populate NA

2015-06-14 Thread Adrian Johnson
Thank you very much. It worked! On Sun, Jun 14, 2015 at 8:00 PM, jim holtman wrote: > Is this what you want: > >> x1 = structure(list(Subject = c("x1", "x2"), A = c(1.5, -1.2), B = c(-1.3, > + -0.3), C = c(0.4, 0.3), D = c(-0.2, -0.1)), .Names = c("Subject", > + "A", "B", "C", "D"), class = "dat

Re: [R] matrix/df help populate NA

2015-06-14 Thread jim holtman
Is this what you want: > x1 = structure(list(Subject = c("x1", "x2"), A = c(1.5, -1.2), B = c(-1.3, + -0.3), C = c(0.4, 0.3), D = c(-0.2, -0.1)), .Names = c("Subject", + "A", "B", "C", "D"), class = "data.frame", row.names = c(NA, + -2L)) > > x2 = structure(list(Subject = c("x1", "x2"), A = c(4.3,

Re: [R] matrix/df help populate NA

2015-06-13 Thread Jeff Newmiller
?merge Particularly look at the all argument. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.

[R] matrix/df help populate NA

2015-06-13 Thread Adrian Johnson
Dear group: I have two data frames. The column names of the two data frame has some common variables but not identical. my aim is to make 2 DFs more uniform by taking union of both colnames For example: I have x1 and x2 matrices: > x1 SubjectAB CD 1 x1 1.5 -1.3 0.4 -0.2