Dear Splus
users,
I hope someone
can help me with the following simple (I?m a beginner Splus user) problem:
I want to move a
subset of rows from one dataset into a new dataset, AND I would also like to
copy each of the column names to the new dataset (I want to make the column names
identical between the two datasets).
I am using
windows version 6.0 Professional release 1. I have been unable to eliminate the error
message that results from my attempts to accomplish these goals. I would be very grateful for any help
you can give me with this. My
program, and the error message are listed below.
Note: Reachdata
is my ?real data? file, datac is the randomized ?real data?, and I wish to
divide the datac file into two by puting 22 rows from the datac file in the
file: data2, while leaving the remaining rows in data1.
MY
PROGRAM:
rm(datac)
rm(data2)
datac<-Reachdatcc
data2<-datac
data2 <- gui.remove.row(target = data2,
target.row.spec = list(1:216))
# Note that I am
removing all of the data (there were 216 rows in the file: data2). This is the only # way that I know of,
for obtaining an empty data file with the column titles/identifications
intact.
data1 <<-
sample(datac, replace=FALSE)
data2 <-
gui.move.row(target = data2, source = data1, source.row.spec = list(1:22),
overwrite = F)
THE ERROR
MESSAGE:
Problem in
copy.row.default(target, target.start.ro..: source and target have incompatible
rows
Use traceback()
to see the call stack
>
traceback()
8: eval(action,
sys.parent())
7:
doErrorAction("Problem in copy.row.default(target, target.start.ro..:
source
and target have incompatible
rows",
6: stop("source
and target have incompatible rows")
5:
copy.row.default(target, target.start.row, source = moved.rows, overwrite =
4:
move.row.default(target, target.row.spec[1], source, source.row.spec,
3:
gui.move.row(target = data2, source = data1, source.row.spec =
list(1:22),
2:
eval(_expression_(data2 <- gui.move.row(target = data2, source = data1,
1: Message:
Problem in copy.row.default(target, target.start.ro..: source and
targ
et have
incompatible rows
Thank you very
much in advance for any help that you can give me with this problem!
Sincerely,
Cynthia
Rejwan