Re: [R] Merging two files together in R

2007-08-24 Thread Adaikalavan Ramasamy
PROTECTED]>] > On Behalf Of Morassa Mohseni > > Sent: 24 August 2007 15:41 > > To: r-help@stat.math.ethz.ch > > Subject: [R] Merging two files together in R > > Hi, > > Thanks in advance for reading this post. > > I received some affymetrix genotyping data b

Re: [R] Merging two files together in R

2007-08-24 Thread Morassa Mohseni
n Behalf Of Morassa Mohseni Sent: 24 August 2007 15:41 To: r-help@stat.math.ethz.ch Subject: [R] Merging two files together in R Hi, Thanks in advance for reading this post. I received some affymetrix genotyping data back recently (250K, Nsp array)...However, in order for me to do any analy

Re: [R] Merging two files together in R

2007-08-24 Thread john seers \(IFR\)
2007 15:41 To: r-help@stat.math.ethz.ch Subject: [R] Merging two files together in R Hi, Thanks in advance for reading this post. I received some affymetrix genotyping data back recently (250K, Nsp array)...However, in order for me to do any analysis on this data set, I need to add append the

Re: [R] Merging two files together in R

2007-08-24 Thread Henrique Dallazuanna
Hi, merge(df.x, df.y, by.x=1) where df.x is your Snpfile and df.y is Annotation file. -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 24/08/07, Morassa Mohseni <[EMAIL PROTECTED]> wrote: > > Hi, > > Thanks in advance for reading this post. > > I received some aff

[R] Merging two files together in R

2007-08-24 Thread Morassa Mohseni
Hi, Thanks in advance for reading this post. I received some affymetrix genotyping data back recently (250K, Nsp array)…However, in order for me to do any analysis on this data set, I need to add append the annotation file to it. Basically I want to do something that looks like this: Snpfile(t

Re: [R] merging more than two data frames

2007-06-23 Thread Mark Wardle
On 22/06/07, Andrew Yee <[EMAIL PROTECTED]> wrote: > I'm familiar with using merge() to merge two data frames. But is there > functionality in R that will let you merge three or more data frames? > I just perform multiple merge() operations iteratively. -- Dr. Mark Wardle Clinical research fell

[R] merging more than two data frames

2007-06-22 Thread Andrew Yee
I'm familiar with using merge() to merge two data frames. But is there functionality in R that will let you merge three or more data frames? Thanks, Andrew [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://s

Re: [R] merging dataframes with diffent rownumbers

2007-06-18 Thread Petr Klasterecky
No easy to understand what exactly you mean, but try ?merge ?cbind ?rbind Petr Thomas Hoffmann napsal(a): > Dear R-Helpers, > > I have following problem: > > I do have two data frames dat1 and dat2 with a commen column BNUM (long > integer). dat1 has a larger number of BNUM than dat2 and diffe

Re: [R] merging dataframes with diffent rownumbers

2007-06-18 Thread Michael Dewey
At 09:09 18/06/2007, Thomas Hoffmann wrote: >Dear R-Helpers, > >I have following problem: > >I do have two data frames dat1 and dat2 with a commen column BNUM >(long integer). dat1 has a larger number of BNUM than dat2 and >different rows of dat2 have equal BNUM. The numbers of rows in dat1 >and

[R] merging dataframes with diffent rownumbers

2007-06-18 Thread Thomas Hoffmann
Dear R-Helpers, I have following problem: I do have two data frames dat1 and dat2 with a commen column BNUM (long integer). dat1 has a larger number of BNUM than dat2 and different rows of dat2 have equal BNUM. The numbers of rows in dat1 and dat2 is not equal. I applied the tapply-function

[R] Merging two data objects question

2007-05-31 Thread Leeds, Mark \(IED\)
I have two R objects, allDataSubset1 and allDataSubset2 and the str of both of them is shown below ( I don't show all 18 lists for space purposes ). The difference between them is that the times ( and possibly the days ) and the data is different and what I want to do is merge them so that only the

Re: [R] merging two lists but get indexes

2007-01-14 Thread Gabor Grothendieck
Try: a <- read.csv("book1.csv", as.is = TRUE) to read the columns in as "character" class rather than the default of "factor" . See ?read.csv On 1/14/07, Teng Sun <[EMAIL PROTECTED]> wrote: > Suppose I have two columns of entries, how can I get the union of the > two columns? Please note: I inpu

Re: [R] merging two lists but get indexes

2007-01-14 Thread Chuck Cleland
Teng Sun wrote: > Suppose I have two columns of entries, how can I get the union of the > two columns? Please note: I input my columns through excel. These > entries have text format in excel. Also, out of curiosity, how can I > find out the data type of a data frame ? df <- data.frame(n1 = c("app

[R] merging two lists but get indexes

2007-01-14 Thread Teng Sun
Suppose I have two columns of entries, how can I get the union of the two columns? Please note: I input my columns through excel. These entries have text format in excel. Also, out of curiosity, how can I find out the data type of a data frame ? > a <- read.csv("book1.csv") > a n1 n2 1

Re: [R] Merging two data sets

2006-12-07 Thread Leeds, Mark \(IED\)
ailto:[EMAIL PROTECTED] On Behalf Of Megh Dal Sent: Thursday, December 07, 2006 3:35 AM To: r-help@stat.math.ethz.ch Subject: [R] Merging two data sets Dear all R users, Suppose I have two datasets: g = 8/11/200592.75 9/11/200592.30 10/11

[R] Merging two data sets

2006-12-07 Thread Megh Dal
Dear all R users, Suppose I have two datasets: g = 8/11/200592.75 9/11/200592.30 10/11/200592.55 11/11/200593.90 11/14/200594.20 11/15/200594.40 11/16/2005

[R] Merging two columns with a single value

2006-11-16 Thread Megan O'Connor
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] Merging two columns with a single value

2006-11-15 Thread Megan O'Connor
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Merging tables of differing lengths

2006-10-17 Thread hadley wickham
>What I want to do is merge these two tables into a 2X10 table in order >to do a chi-square test. Given the unequal number of columns, all my You might want to try something like: levs <- unique(c(wintype1, wintype2)) table(factor(wintype1, levels=lev)) table(factor(wintype2, levels=lev

[R] Merging tables of differing lengths

2006-10-17 Thread David R. Gagnon
Hi, I am using the table() function on two different vectors to obtain a frequency distribution for each: >tabtyp1 <- table(wintype1) >tabtyp2 <- table(wintype2) The resulting tables look like this: > tabtyp1 <- table(wintype1) > tabtyp2 <- table(wintype2) > tabtyp1

Re: [R] merging tables by columns AND rows

2006-09-07 Thread isidora k
Some of the coordinates might not match and also I do not have the same number of observations in every table but I want to get only the common ones back. This is where it gets tricky!I have tried merge, scan and every joining function I could find but nothing seems to do what I want. the R-sig-geo

Re: [R] merging tables by columns AND rows

2006-09-07 Thread Roger Bivand
On Thu, 7 Sep 2006, isidora k wrote: > Hi everyone! > I have 100 tables of the form: > XCOORD,YCOORD,OBSERVATION > 27.47500,42.52641,177 > 27.48788,42.52641,177 > 27.50075,42.52641,179 > 27.51362,42.52641,178 > 27.52650,42.52641,180 > 27.53937,42.52641,178 > 27.55225,42.52641,181 > 27.56512,42.526

[R] merging tables by columns AND rows

2006-09-07 Thread isidora k
Hi everyone! I have 100 tables of the form: XCOORD,YCOORD,OBSERVATION 27.47500,42.52641,177 27.48788,42.52641,177 27.50075,42.52641,179 27.51362,42.52641,178 27.52650,42.52641,180 27.53937,42.52641,178 27.55225,42.52641,181 27.56512,42.52641,177 27.57800,42.52641,181 27.59087,42.52641,181 27.60375,

Re: [R] Merging files function

2006-06-01 Thread Gavin Simpson
On Thu, 2006-06-01 at 09:16 -0400, Chuck Cleland wrote: > Ahamarshan jn wrote: > > hi list, > > > > This question must be very basic but I am just 3 days > > old to R, so I think i can ask. I am trying to find a > > function to merge two > > tables of data in two different files as one. > > > >

Re: [R] Merging files function

2006-06-01 Thread Chuck Cleland
Ahamarshan jn wrote: > hi list, > > This question must be very basic but I am just 3 days > old to R, so I think i can ask. I am trying to find a > function to merge two > tables of data in two different files as one. > > Does merge function only fills in colums between two > table where data is

[R] Merging files function

2006-06-01 Thread Ahamarshan jn
hi list, This question must be very basic but I am just 3 days old to R, so I think i can ask. I am trying to find a function to merge two tables of data in two different files as one. Does merge function only fills in colums between two table where data is missing or is there a way that merge c

Re: [R] merging

2006-05-31 Thread Gavin Simpson
On Tue, 2006-05-30 at 15:09 -0500, Sundar Dorai-Raj wrote: > > Gavin Simpson wrote: > > Dear List, > > Will this help: > > rbind.all <- function(...) { >x <- list(...) >cn <- unique(unlist(lapply(x, colnames))) >for(i in seq(along = x)) { > if(any(m <- !cn %in% colnames(x[[i]])

Re: [R] merging

2006-05-30 Thread Marc Schwartz (via MN)
On Tue, 2006-05-30 at 15:38 -0500, Marc Schwartz (via MN) wrote: > On Tue, 2006-05-30 at 19:08 +0100, Gavin Simpson wrote: > > Dear List, > > > > Given, > > > > y <- matrix(c(0,1,1,1,0,0,0,4,4), ncol = 3, byrow = TRUE) > > rownames(y) <- c("a","b","c") > > colnames(y) <- c("1","2","3") > > y > >

Re: [R] merging

2006-05-30 Thread Marc Schwartz (via MN)
On Tue, 2006-05-30 at 19:08 +0100, Gavin Simpson wrote: > Dear List, > > Given, > > y <- matrix(c(0,1,1,1,0,0,0,4,4), ncol = 3, byrow = TRUE) > rownames(y) <- c("a","b","c") > colnames(y) <- c("1","2","3") > y > y2 <- y[2:3, ] > rownames(y2) <- c("x","z") > y2 > > how can I stop > > merge(y, y2

Re: [R] merging

2006-05-30 Thread Sundar Dorai-Raj
Gavin Simpson wrote: > Dear List, > > Given, > > y <- matrix(c(0,1,1,1,0,0,0,4,4), ncol = 3, byrow = TRUE) > rownames(y) <- c("a","b","c") > colnames(y) <- c("1","2","3") > y > y2 <- y[2:3, ] > rownames(y2) <- c("x","z") > y2 > > how can I stop > > merge(y, y2, all = TRUE, sort = FALSE) > >

[R] merging

2006-05-30 Thread Gavin Simpson
Dear List, Given, y <- matrix(c(0,1,1,1,0,0,0,4,4), ncol = 3, byrow = TRUE) rownames(y) <- c("a","b","c") colnames(y) <- c("1","2","3") y y2 <- y[2:3, ] rownames(y2) <- c("x","z") y2 how can I stop merge(y, y2, all = TRUE, sort = FALSE) squishing the extra rows? Ideally I want the same as: rb

Re: [R] Merging data

2006-02-22 Thread Liaw, Andy
Something like this? > data1 <- data.frame(id=c(1, 3, 5), x=runif(3)) > data2 <- data.frame(id=1:10, y=runif(10)) > data3 <- merge(data1, data2, by="id", all.x=TRUE, all.y=FALSE) > data3 id x y 1 1 0.9533341 0.1803271 2 3 0.9143624 0.5033228 3 5 0.2866931 0.4233733 Andy From

Re: [R] Merging data

2006-02-22 Thread Chuck Cleland
Brian Perron wrote: > Hello all, > > I am fairly new to R and am trying to bring together data from multiple > sources. Here is one problem that I cannot seem to crack – I hope somebody > can help. Let me simplify the problem: Let’s say I have two datasets: > DATA1 and DATA2. I would like

[R] Merging data

2006-02-22 Thread Brian Perron
Hello all, I am fairly new to R and am trying to bring together data from multiple sources. Here is one problem that I cannot seem to crack – I hope somebody can help. Let me simplify the problem: Let’s say I have two datasets: DATA1 and DATA2. I would like to work with all the cases in DA

Re: [R] Merging lists on common key (was )

2005-12-15 Thread Florence Combes
Dear Marc, Dear all, I saw your e-mail about "merge()" and I take the occasion to ask something to you I already asked on the list but without success. I searched long without finding, maybe you have a clue ... I am looking for a function which performs the same as "merge()" but for more than 2 li

Re: [R] Merging lists on common key (was )

2005-12-14 Thread Marc Schwartz
On Wed, 2005-12-14 at 18:14 -0800, Marco Blanchette wrote: > Dear all, > > I am still fairly new to R and try to analyze large tables of data generated > from genomic experiment. Currently, I am trying to plot pair of experiments > coming from different file, trying to look at the behavior of indi

Re: [R] merging with aggregating

2005-12-06 Thread Pierre Kleiber
Here's a solution that uses aggregate(), as suggested in the subject of this thread. > m1 <- cbind( n=c(1,2,3,4,6,7,8,9,10,13), v1=c(12,10,3,8,7,12,1,18,1,2), > v2=c(0,8,8,4,3,0,0,0,0,0) ) > > m2 <- cbind( n=c(1,2,3,4,5,6,8,10,11,12), v1=c(0,0,1,12,2,2,2,4,7,0), >

Re: [R] merging with aggregating

2005-12-06 Thread Marc Schwartz (via MN)
On Tue, 2005-12-06 at 15:19 +0100, Dubravko Dolic wrote: > Hi all, > > the moment you hit the 'send' button you know the answer... > > I approached a solution similar to this one given by Marc. But maybe > there is a better one? Even because this operation is done in a > for-loop during which R g

Re: [R] merging with aggregating

2005-12-06 Thread Adaikalavan Ramasamy
m1 <- cbind( n=c(1,2,3,4,6,7,8,9,10,13), v1=c(12,10,3,8,7,12,1,18,1,2), v2=c(0,8,8,4,3,0,0,0,0,0) ) m2 <- cbind( n=c(1,2,3,4,5,6,8,10,11,12), v1=c(0,0,1,12,2,2,2,4,7,0), v2=c(2,3,9,8,9,9,0,1,1,1) ) m.all <- merge(m1, m2, by="n", all=T) n v1.x v2.x v1.y v2

Re: [R] merging with aggregating

2005-12-06 Thread Dubravko Dolic
eventually. Dubro -Ursprüngliche Nachricht- Von: Marc Schwartz [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 6. Dezember 2005 15:11 An: Dubravko Dolic Cc: r-help@stat.math.ethz.ch Betreff: Re: [R] merging with aggregating On Tue, 2005-12-06 at 14:22 +0100, Dubravko Dolic wrote: > Dear

Re: [R] merging with aggregating

2005-12-06 Thread Marc Schwartz
On Tue, 2005-12-06 at 14:22 +0100, Dubravko Dolic wrote: > Dear List, > > I have two data.frame of the following form: > > A: > > n V1 V2 > 1 12 0 > 2 10 8 > 3 3 8 > 4 8 4 > 6 7 3 > 7 12 0 > 8 1 0 > 9 18 0 > 10 1 0 > 13 2 0 > > B: > > n V1 V2 > 1 0 2 > 2 0

[R] merging with aggregating

2005-12-06 Thread Dubravko Dolic
Dear List, I have two data.frame of the following form: A: n V1 V2 1 12 0 2 10 8 3 3 8 4 8 4 6 7 3 7 12 0 8 1 0 9 18 0 10 1 0 13 2 0 B: n V1 V2 1 0 2 2 0 3 3 1 9 4 12 8 5 2 9 6 2 9 8 2 0 10 4 1 11 7 1 12 0 1 Now I want to merge thos

Re: [R] merging dataframes

2005-11-03 Thread Gavin Simpson
On Thu, 2005-11-03 at 08:33 -0500, Liaw, Andy wrote: > The `Value' section of ?merge does say that `... in all cases the result has > no special row names', so you're left to handle that on your own. One > possibility is to use > > result <- merge(mat1, mat2, all=TRUE, sort=FALSE) > > so that

[R] merging dataframes

2005-11-03 Thread ManuelPerera-Chang
Hi, what about padding both datasets with dummy missing records ... and then play with cbind and rbind ... like e.g. > species5<-c(NA,NA,NA,NA) > modmat2<-cbind(mat2,species1,species5) and then similarly with mat1 ... e.g. species2<-c(NA,NA,NA,NA,NA) > modmad1<-cbind(mat1,species2,species

Re: [R] merging dataframes

2005-11-03 Thread Liaw, Andy
The `Value' section of ?merge does say that `... in all cases the result has no special row names', so you're left to handle that on your own. One possibility is to use result <- merge(mat1, mat2, all=TRUE, sort=FALSE) so that the sorting is not done, then you can just do rownames(result) <

Re: [R] merging dataframes

2005-11-03 Thread Dimitris Rizopoulos
"R-help" Sent: Thursday, November 03, 2005 2:08 PM Subject: [R] merging dataframes > Dear List, > > I often have to merge two or more data frames containing unique row > names but with some columns (names) common to the two data frames > and > some columns not common. This

Re: [R] merging dataframes

2005-11-03 Thread Roger Bivand
On Thu, 3 Nov 2005, Gavin Simpson wrote: > Dear List, > > I often have to merge two or more data frames containing unique row > names but with some columns (names) common to the two data frames and > some columns not common. This toy example will explain the kind of setup > I am talking about: >

[R] merging dataframes

2005-11-03 Thread Gavin Simpson
Dear List, I often have to merge two or more data frames containing unique row names but with some columns (names) common to the two data frames and some columns not common. This toy example will explain the kind of setup I am talking about: mat1 <- as.data.frame(matrix(rnorm(20), nrow = 5)) mat2

[R] Merging nlme output

2004-05-28 Thread Harold Doran
Dear list: I am trying to merge two files together from output I get based on the coef() command. Here is what I am running into. I have two simple linear mixed models > mod1.lme<-lme(math~year, data=sample, random=~year|childid/schoolid) > mod2.lme<-lme(math~year, data=sample, random=~year|ch

R: [R] merging variable and character

2003-11-24 Thread Vito Muggeo
PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 24, 2003 10:51 AM Subject: [R] merging variable and character Hi R lovers! I'd like to know the trick to get a plot with a title associating variable and text I'd like to plot something like for (i in 1:10) plot(x[,i],ylab=&q

Re: [R] merging variable and character

2003-11-24 Thread Ivar Herfindal
Hello Try ?paste plot(x[,i],ylab=paste("Serie", i)) Ivar Herfindal On Mon, 24 Nov 2003 10:51:11 +0100, STOLIAROFF VINCENT <[EMAIL PROTECTED]> wrote: Hi R lovers! I'd like to know the trick to get a plot with a title associating variable and text I'd like to plot something like for (i in 1

[R] merging variable and character

2003-11-24 Thread STOLIAROFF VINCENT
Hi R lovers! I'd like to know the trick to get a plot with a title associating variable and text I'd like to plot something like for (i in 1:10) plot(x[,i],ylab="Serie" & i) to get Serie 1 Serie 2 so on and so forth... of course it doesn't work. If somebody could give me an idea, it wou

RE: [R] Merging and sorting multiple data.frame

2003-08-15 Thread Hotz, T.
CTED] > Sent: 15 August 2003 17:07 > To: '[EMAIL PROTECTED]' > Subject: [R] Merging and sorting multiple data.frame > > > Dear R help, > I'm pretty new to R and would be grateful for help. > > I have 11 data.frames, each with 3 columns of data. E

[R] Merging and sorting multiple data.frame

2003-08-15 Thread Culhane, Aedin
Dear R help, I'm pretty new to R and would be grateful for help. I have 11 data.frames, each with 3 columns of data. Each has the same row.names, however these are not sorted. Please tell me the best way to sort these (by row.names) and secondly the best way to extract data columns from these to