Re: [R] Joining variables
At 21:01 24/05/2006, [EMAIL PROTECTED] wrote: Hello, Although I cannot speak for the original individual posting this question but I would like to see an example, if possible, of how to construct a factor of several factors. ?interaction (assuming I understand you correctly) I think this would be more efficient than paste if such a procedure were possible and, of course, would also answer the postee's original question. Many thanks, Mark LoPresti Thomson Financial/Research Group -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Berton Gunter Sent: Wednesday, May 24, 2006 2:54 PM To: 'Guenther, Cameron'; r-help@stat.math.ethz.ch Subject: Re: [R] Joining variables What does combination of both mean exactly. I can think of two interpretations that have two different answers. If you give a small example (as the posting guide suggests) it would certainly help me provide an answer. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Guenther, Cameron Sent: Wednesday, May 24, 2006 11:46 AM To: r-help@stat.math.ethz.ch Subject: [R] Joining variables Hello, If I have two variables that are factors or characters and I want to create a new variable that is the combination of both what function can I use to accomplish this? Ex. Var1 Var2 SA100055113 19851113 And I want NewVar SA10005511319851113 Thanks in advance. Cameron Guenther, Ph.D. Associate Research Scientist FWC/FWRI, Marine Fisheries Research 100 8th Avenue S.E. St. Petersburg, FL 33701 (727)896-8626 Ext. 4305 [EMAIL PROTECTED] __ 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 __ 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 Michael Dewey [EMAIL PROTECTED] http://www.aghmed.fsnet.co.uk/home.html __ 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
[R] Joining variables
Hello, If I have two variables that are factors or characters and I want to create a new variable that is the combination of both what function can I use to accomplish this? Ex. Var1Var2 SA100055113 19851113 And I want NewVar SA10005511319851113 Thanks in advance. Cameron Guenther, Ph.D. Associate Research Scientist FWC/FWRI, Marine Fisheries Research 100 8th Avenue S.E. St. Petersburg, FL 33701 (727)896-8626 Ext. 4305 [EMAIL PROTECTED] __ 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
Re: [R] Joining variables
On Wed, 2006-05-24 at 14:45 -0400, Guenther, Cameron wrote: Hello, If I have two variables that are factors or characters and I want to create a new variable that is the combination of both what function can I use to accomplish this? Ex. Var1 Var2 SA100055113 19851113 And I want NewVar SA10005511319851113 Thanks in advance. See ?paste and note the 'sep' argument: NewVar - paste(Var1, Var2, sep = ) NewVar [1] SA10005511319851113 HTH, Marc Schwartz __ 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
Re: [R] Joining variables
Thanks to all who responded. The paste function is what I was looking for. Thanks again. Cameron Guenther, Ph.D. Associate Research Scientist FWC/FWRI, Marine Fisheries Research 100 8th Avenue S.E. St. Petersburg, FL 33701 (727)896-8626 Ext. 4305 [EMAIL PROTECTED] -Original Message- From: Berton Gunter [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 24, 2006 2:54 PM To: Guenther, Cameron; r-help@stat.math.ethz.ch Subject: RE: [R] Joining variables What does combination of both mean exactly. I can think of two interpretations that have two different answers. If you give a small example (as the posting guide suggests) it would certainly help me provide an answer. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Guenther, Cameron Sent: Wednesday, May 24, 2006 11:46 AM To: r-help@stat.math.ethz.ch Subject: [R] Joining variables Hello, If I have two variables that are factors or characters and I want to create a new variable that is the combination of both what function can I use to accomplish this? Ex. Var1 Var2 SA100055113 19851113 And I want NewVar SA10005511319851113 Thanks in advance. Cameron Guenther, Ph.D. Associate Research Scientist FWC/FWRI, Marine Fisheries Research 100 8th Avenue S.E. St. Petersburg, FL 33701 (727)896-8626 Ext. 4305 [EMAIL PROTECTED] __ 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 __ 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
Re: [R] Joining variables
Guenther, Cameron wrote: Hello, If I have two variables that are factors or characters and I want to create a new variable that is the combination of both what function can I use to accomplish this? Ex. Var1 Var2 SA100055113 19851113 And I want NewVar SA10005511319851113 Thanks in advance. See ?paste or ?sprintf Var1 - factor(SA100055113) Var2 - 19851113 NewVar - paste(Var1, Var2, sep = ) NewVar - sprintf(%s%s, Var1, Var2) HTH, --sundar __ 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
Re: [R] Joining variables
What does combination of both mean exactly. I can think of two interpretations that have two different answers. If you give a small example (as the posting guide suggests) it would certainly help me provide an answer. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Guenther, Cameron Sent: Wednesday, May 24, 2006 11:46 AM To: r-help@stat.math.ethz.ch Subject: [R] Joining variables Hello, If I have two variables that are factors or characters and I want to create a new variable that is the combination of both what function can I use to accomplish this? Ex. Var1 Var2 SA100055113 19851113 And I want NewVar SA10005511319851113 Thanks in advance. Cameron Guenther, Ph.D. Associate Research Scientist FWC/FWRI, Marine Fisheries Research 100 8th Avenue S.E. St. Petersburg, FL 33701 (727)896-8626 Ext. 4305 [EMAIL PROTECTED] __ 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 __ 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
Re: [R] Joining variables
look at ?paste(). Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm Quoting Guenther, Cameron [EMAIL PROTECTED]: Hello, If I have two variables that are factors or characters and I want to create a new variable that is the combination of both what function can I use to accomplish this? Ex. Var1 Var2 SA100055113 19851113 And I want NewVar SA10005511319851113 Thanks in advance. Cameron Guenther, Ph.D. Associate Research Scientist FWC/FWRI, Marine Fisheries Research 100 8th Avenue S.E. St. Petersburg, FL 33701 (727)896-8626 Ext. 4305 [EMAIL PROTECTED] __ 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 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ 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
Re: [R] Joining variables
Hello, Although I cannot speak for the original individual posting this question but I would like to see an example, if possible, of how to construct a factor of several factors. I think this would be more efficient than paste if such a procedure were possible and, of course, would also answer the postee's original question. Many thanks, Mark LoPresti Thomson Financial/Research Group -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Berton Gunter Sent: Wednesday, May 24, 2006 2:54 PM To: 'Guenther, Cameron'; r-help@stat.math.ethz.ch Subject: Re: [R] Joining variables What does combination of both mean exactly. I can think of two interpretations that have two different answers. If you give a small example (as the posting guide suggests) it would certainly help me provide an answer. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Guenther, Cameron Sent: Wednesday, May 24, 2006 11:46 AM To: r-help@stat.math.ethz.ch Subject: [R] Joining variables Hello, If I have two variables that are factors or characters and I want to create a new variable that is the combination of both what function can I use to accomplish this? Ex. Var1 Var2 SA100055113 19851113 And I want NewVar SA10005511319851113 Thanks in advance. Cameron Guenther, Ph.D. Associate Research Scientist FWC/FWRI, Marine Fisheries Research 100 8th Avenue S.E. St. Petersburg, FL 33701 (727)896-8626 Ext. 4305 [EMAIL PROTECTED] __ 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 __ 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 __ 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