Many thanks to anyone who can assist. I've previously been using read.table
to import large datasets which relate to medical imaging analysis. After
labelling the columns, I've then extracted a subset of the data, referenced
by the column name, which gives me the flexibility to handle slightly
different datasets with the columns in a different order.
In my most recent import however, splus has refused to recognise one of the
columns in the dataset, so that the dataframe "slice" as defined below is
missing the third column, headed "y":
slice <- data.frame(read.table(filename,skip=1,sep=","))
colIds(slice) <- c("z", "x", "y", "A", "B", "C", "D", "arrival", "area",
"chi", "MTT", "peak.time", "opac", "air", "water", "blood", "tissue",
"perfusion", "flow", "BF.tiss", "BF.Air", "BF.water", "sepindex",
"MTTdecon", "contam", "endtime", "BFraction", "TFraction", "rising.time",
"X", "Y", "Volume")
attach(slice)
slice <- data.frame(cbind(z, x, y, arrival, chi, MTT, peak time, opac, air,
water, blood, tissue, perfusion))
detach()
There is no other variable called "y" in the search path with which
ambiguity could arise. Instead of attaching the file slice, I have also
tried the longhand:
slice <- data.frame(cbind(slice$z, slice$x, slice$y, slice$arrival,
slice$chi, slice$MTT, slice$peak slice$time, slice$opac, slice$air,
slice$water, slice$blood, slice$tissue, slice$perfusion))
but this causes problems as all the column Ids are lost in creation of the
subset.
Is there anything obviously wrong or inadvisable in what I'm attempting to
do ? It has worked well with previous files up until now.
I'm using splus version 6 under W2K.
Many thanks
Jonathan Dakin
Clinical Research Fellow
Imperial College
|