[R] How to save my result with Loops

John Kane jrkrideau at inbox.com
Sun Jun 17 16:09:54 CEST 2012


It is not clear exactly what you want.  Are you saying that you want to create an object out of each number in that vector or do you just want to name each element in the vector?

It is best to supply the code that you used so that readers can see what you are doing.  

Also when you are providing data please use something like dput()

Let's say your vector is called vec.  You can type dput(vec) and get a data structure that you can copy and paste into your email and which a reader can directly paste into R.


John Kane
Kingston ON Canada


> -----Original Message-----
> From: letamotta at hotmail.com
> Sent: Sun, 17 Jun 2012 06:30:13 -0700 (PDT)
> To: r-help at r-project.org
> Subject: [R] How to save my result with Loops
> 
> Hi everyone, i'm not very good with R, and i know that my question is
> quite
> simple.
> I generated this vector for a sample of 100 and i want to know how to
> save
> these as
> ez1, ez1, ez3...ez100.
> I guess i have to do it by  "for", but i didn't succeed..
> i put here my output
> 
> ezt
>   [1] -0.05470228 -1.76356668 -1.68843463 -0.77283767  0.25077826
> -0.65236833  1.05230056 -0.48900254 -1.03857310 -0.30378185  0.86384470
> 1.35341065 -0.55714575
>  [14] -0.31853348  0.48801617  1.98541092 -2.52174364  0.17085272
> 0.63973657  1.07164064 -0.35393600  0.61847775  1.18536018  1.40576222
> 0.88830675 -0.84600747
>  [27] -0.80453071 -2.90893372  0.47658777 -0.74312903  0.51442825
> 0.22481451 -0.33104807  0.63688003  1.75841693  0.34841081 -1.18367323
> -0.80041424  0.14039505
>  [40]  0.78883365  1.50628498  0.81714749 -1.50882506 -1.11457623
> -0.11722597 -0.23157740 -0.50457286 -0.76091885  0.89006377 -0.33416350
> -2.27666710 -0.71381032
>  [53] -2.12997125 -0.88065165  0.49617389  1.06932037 -0.88977000
> -1.11977792  0.33601881  0.50490347 -1.46019653  1.30649432 -1.51794234
> 0.26189545  0.86140985
>  [66]  1.31436956  2.63651459  0.77599055  0.51114807  0.39171407
> -0.07196456 -0.60086534  0.70217126  1.31626039 -0.67222186 -0.17144670
> 0.32945944 -0.36040439
>  [79] -1.56054165 -2.73620770  0.73432896  0.37370346  0.20326237
> 0.72310549 -1.65473285  0.03052296  2.18543356 -1.80562305  1.32452946
> 0.41418175 -1.82803429
>  [92] -2.42929015  0.71443886 -1.13828906  2.30465334 -0.72840312
> 0.49937916  0.66331583 -0.05890777 -0.98056989
>> 
> 
> thank you very much
> 
> --
> View this message in context:
> http://r.789695.n4.nabble.com/How-to-save-my-result-with-Loops-tp4633640.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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.

____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!



More information about the R-help mailing list