[R] Problems with Merge

2007-06-05 Thread Patnaik, Tirthankar
Hi, I have a history dataset, a matrix with about 1590 obs, and 242 cols, and I need to update this matrix with an 'update' matrix that has about 30 rows, and roughly similar number of columns as the history ds (but not necessarily equal). The update dataset is read from an Excel ODBC connection.

Re: [R] Problems with Merge

2007-06-05 Thread Prof Brian Ripley
Take a look at the help for merge(): in all the examples by.x is a character string, not a one-column data frame which is what rhistory[Date] would appear to be. Please note the trailer of this messsage. On Tue, 5 Jun 2007, Patnaik, Tirthankar wrote: Hi, I have a history dataset, a matrix

Re: [R] Problems with Merge

2007-06-05 Thread Patnaik, Tirthankar
Subject: Re: [R] Problems with Merge Take a look at the help for merge(): in all the examples by.x is a character string, not a one-column data frame which is what rhistory[Date] would appear to be. Please note the trailer of this messsage. On Tue, 5 Jun 2007, Patnaik, Tirthankar wrote

Re: [R] Problems with merge

2004-10-07 Thread Don MacQueen
At 10:44 AM +0530 10/6/04, Vikas Rawal wrote: This issue has been discussed on this list before but the solutions offerred are not satisfactory. So I thought I shall raise it again. I want to merge two datasets which have three common variables. These variables DO NOT have the same names in

Re: [R] Problems with merge

2004-10-06 Thread TEMPL Matthias
Hello, You can change e.g. the second column name in the following way: data(iris) colnames(iris) [1] Sepal.Length Sepal.Width Petal.Length Petal.Width Species To change the second column name: colnames(iris)[2] - name colnames(iris) [1] Sepal.Length name Petal.Length Petal.Width

Re: [R] Problems with merge

2004-10-06 Thread Karl Knoblick
Hello! merge(TablePatient, TableSpecial, by.x=ID, by.y=PATIENTID) works fine for me. (There is also a variable ID in TableSpecial). One problem - or what has to be known - is that merge is using the levels, not the labels, if the merged variables are factors. Karl

Re: [R] Problems with merge

2004-10-06 Thread Thomas Lumley
On Wed, 6 Oct 2004, Vikas Rawal wrote: The problem is that R allows you to use by.x and by.y variables to specify only one variable in x dataset and one variable in y dataset to merge. This turns out not to be the case. names(df) [1] x y z names(df2) [1] a b c

[R] Problems with merge

2004-10-05 Thread Vikas Rawal
This issue has been discussed on this list before but the solutions offerred are not satisfactory. So I thought I shall raise it again. I want to merge two datasets which have three common variables. These variables DO NOT have the same names in both the files. In addition, there are two