[R] Unlist alternatives?
Joshua Wiley
jwiley.psych at gmail.com
Tue Oct 25 05:13:01 CEST 2011
Hi Kyle,
blups=ranef(modelrandom)[[1]]
should give you a data frame, the rownames of which are your strain (I
think). If that doesn't work, it would be great if you could post
some data so we see what you see.
Cheers,
Josh
On Mon, Oct 24, 2011 at 6:53 PM, kickout <kyle.kocak at gmail.com> wrote:
> dfhfsdhf at ghghgr.com
>
> I ran a simple lme model:
>
> modelrandom=lmer(y~ (1|Test) + (1|strain), data=tempsub)
>
> Extracted the BLUPs:
>
> blups=ranef(modelrandom)[1]
>
> Even wrote myself a nice .csv file....:
>
> write.csv(ranef(modelrandom)[1],paste(x,"BLUPs.CSV"))
>
> This all works great. I end up with a .csv file with the names of my strains
> in the first column and the BLUP in the second column....(I am only
> concerned with the strains, the second list is the estimates of 'Test').
>
> However i have tried every possible way to unlist 'blups' so that is retains
> the names of my strain AND the blups...
>
> Theoretically it should be a 13x2 matrix (one column for blup, other for
> strain). However no function i have tried retains the names of the
> strains....any ideas?
>
> Tried: unlist, concerting to data.frame or matrix, various plyr
> functions....but nothing...
>
> All i want is a matrix in R that has a column of blups and strain
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Unlist-alternatives-tp3935331p3935331.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, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/
More information about the R-help
mailing list