Sri krishna Devarayalu Balanagu
2012-Sep-17 12:13 UTC
[R] I want to send the vector a into the Object A.......
a=c(1,2,3) b=c(23, 24, 25) x=c("a", "b") #if (length(x[1]) == 0) {cat("x[1] is having 3 elements")} Suppose I want to send the vector a into the Object A, um getting only "a" as the ouput for Object A but not getting required output as the vector with the elements 1, 2, 3 with the following code A<- x[1] How to code it? Can anyone help? Notice: The information contained in this electronic mail message is intended only for the use of the designated recipient. This message is privileged and confidential. and the property of GVK BIO or its affiliates and subsidiaries. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone +91-40-66929999<tel:+91-40-66929999> and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies). [[alternative HTML version deleted]]
Heramb Gadgil
2012-Sep-17 15:23 UTC
[R] I want to send the vector a into the Object A.......
A<- get("a") This will work fine Best, Heramb On Mon, Sep 17, 2012 at 5:43 PM, Sri krishna Devarayalu Balanagu < balanagudevarayulu@gvkbio.com> wrote:> a=c(1,2,3) > b=c(23, 24, 25) > x=c("a", "b") > #if (length(x[1]) == 0) {cat("x[1] is having 3 elements")} > > Suppose I want to send the vector a into the Object A, > um getting only "a" as the ouput for Object A but not getting required > output as the vector with the elements 1, 2, 3 with the following code > > A<- x[1] > > How to code it? > Can anyone help? > Notice: The information contained in this electronic mail message is > intended only for the use of the designated recipient. This message is > privileged and confidential. and the property of GVK BIO or its affiliates > and subsidiaries. If the reader of this message is not the intended > recipient or an agent responsible for delivering it to the intended > recipient, you are hereby notified that you have received this message in > error and that any review, dissemination, distribution, or copying of this > message is strictly prohibited. If you have received this communication in > error, please notify us immediately by telephone > +91-40-66929999<tel:+91-40-66929999> and destroy any and all copies of this > message in your possession (whether hard copies or electronically stored > copies). > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org 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. >[[alternative HTML version deleted]]
Hi,After second thought, May be this:get(A) [1] 1 2 3 A.K. ----- Original Message ----- From: Sri krishna Devarayalu Balanagu <balanagudevarayulu at gvkbio.com> To: "r-help at r-project.org" <r-help at r-project.org> Cc: Sent: Monday, September 17, 2012 8:13 AM Subject: [R] I want to send the vector a into the Object A....... a=c(1,2,3) b=c(23, 24, 25) x=c("a", "b") #if (length(x[1]) == 0) {cat("x[1] is having 3 elements")} Suppose I want to send the vector a into the Object A, um getting only "a" as the ouput for Object A but not getting required output as the vector with the elements 1, 2, 3 with? the following code A<- x[1] How to code it? Can anyone help? Notice: The information contained in this electronic mail message is intended only for the use of the designated recipient. This message is privileged and confidential. and the property of GVK BIO or its affiliates and subsidiaries. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone +91-40-66929999<tel:+91-40-66929999> and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies). ??? [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org 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.
Jean V Adams
2012-Sep-17 16:53 UTC
[R] I want to send the vector a into the Object A.......
Try this. A <- get(x[1]) Jean Sri krishna Devarayalu Balanagu <balanagudevarayulu@gvkbio.com> wrote on 09/17/2012 07:13:51 AM:> > a=c(1,2,3) > b=c(23, 24, 25) > x=c("a", "b") > #if (length(x[1]) == 0) {cat("x[1] is having 3 elements")} > > Suppose I want to send the vector a into the Object A, > um getting only "a" as the ouput for Object A but not getting > required output as the vector with the elements 1, 2, 3 with the > following code > > A<- x[1] > > How to code it? > Can anyone help?[[alternative HTML version deleted]]
Reasonably Related Threads
- How can I get the Ids with Duplicated key and corresponding Ids with original key?
- How can we compare two vectors?
- Why x[1] is not getting substituted?
- How to find the non matching vectors among these five, if so how we can find the non matching element of that vectors?
- Why the result is coming as NULL?