[R] Storing datasets

Joshua Wiley jwiley.psych at gmail.com
Tue Jun 12 09:41:27 CEST 2012


On Tue, Jun 12, 2012 at 12:24 AM, Rody <rodric_seutin at hotmail.com> wrote:
> I found a solution myself, but thanks for the answers. I solved it like this:
> D <- matrix(1:225*100,nrow=100,ncol=225)
> for(i in 1:225)
>     D[,i] <- rt(100,df=225)
> end

but as Don said, you can do this in one step (and it is both faster
and more elegant).

D <- matrix(rt(100 * 225, df = 225), ncol = 225)

Cheers,

Josh

>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Storing-datasets-tp4632874p4633071.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.



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/



More information about the R-help mailing list