Try this...
a<-c("abc","def","ghi","klm","nop","qrs","tuv","wxyz")
b<-data.frame()
for (i in 1:length(a)){
b<-paste(b,a[i],sep="")
}
print(b)
Thanks
Arun
---
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-get-all-list-item-to-one-string-variable-tp4636283p4636291.html
S
I am creating a nested for loop and following are the codes I'm using, but I
am not acheiving what I want.
I have a vector
d<-151:159
I have another vector
e<-e<-c("apple", "orange", "banana")
I need to create f as
151apple
151orange
151banana
.
.
159apple
159orange
159banana
Here is how I w
I am executing the following loops in R 15.1.0 and the first one works and
produces results. However, the second one is not with initiating the object
as x[i]. Further, I was able to get the second loop work in R 15.0. Am I
missing something here?
for(i in 1:length(b))
{y[i]<-paste(a,b[i],c,sep=""
If you haven't already look at Introduction to R, please follow this link
"http://cran.r-project.org/doc/manuals/R-intro.pdf";. There are several books
which will teach you R, please look at online retailers like Amazon, Ebay
etc.,
Online search for specific task will also to help you to gather kn
Dr. Petris,
Thank you so much for your help. I appreciate it. I am still learning R!
Thanks
Arun
--
View this message in context:
http://r.789695.n4.nabble.com/Simple-For-Loop-Help-tp4517088p4519056.html
Sent from the R help mailing list archive at Nabble.com.
_
Hi,
I need help with the following.
I have a dataset Y with 200 observations and three variables Y1, Y2 & Y3. I
have to find the minimum of Y1, Y2 & Y3 and if the minimum is Y1 then I have
to assign 1 to a variable (Y4), if Y2 is the minimum then "2" to Y4 else
"3" to Y4. This is what I have done
6 matches
Mail list logo