I start with a dataframe called xrays. It contains scores on films from
each of two radiologists. It is in "long" format. I used the reshape
package to melt a data frame and then cast it into "wide" format, one
line for each patient (identified by redlognumb) with scores from both
radiologists for a given patient on the same line.
I named the result of the casting xrays.data. It is an array. I'd like
it to be a three-variable dataframe, with one column for scores from
each of two radiologists, and one column for redlognumb (because I will
then need to merge it with another dataframe that has a column named
redlognumb.) As you can see below, the data.frame() function turns
xrays.data into a two-variable dataframe. How can I get three columns
(or variables) into my final dataframe?
Thanks.
X1.barrtotal X2.barrtotal
1 11 NA
2 2 NA
3 12 13
4 16 16
5 12 10
6 13 11
7 18 NA
8 8 NA
. . . . cut off for brevity . . .
Christopher W. Ryan, MD
SUNY Upstate Medical University Clinical Campus at Binghamton
40 Arch Street, Johnson City, NY 13790
cryanatbinghamtondotedu
PGP public keys available at http://home.stny.rr.com/ryancw/
"If you want to build a ship, don't drum up the men to gather wood,
divide the work and give orders. Instead, teach them to yearn for the
vast and endless sea." [Antoine de St. Exupery]