[R] Naming objects in a list
jholtman at gmail.com
Fri Oct 9 14:01:10 CEST 2009
A couple of ways:
List.glm <- list()
for(i in 1:n) list.glm[[i]] <-glm(,,,)
List.glm <- lapply(1:n, function(x) glm(,,,))
On Fri, Oct 9, 2009 at 7:54 AM, P.Branco <pjlbranco at yahoo.com> wrote:
> I am trying to run a for-loop in which I want to add glm output objects
> sequentially into a list. I do not know how to give names to each object in
> a list. I tried this :
> List.glm <- list()
> for(i in 1:n)
> list.glm <- list(list.glm, glm(,,,))
> but it is obviously unsuited…
> Best regards,
> View this message in context: http://www.nabble.com/Naming-objects-in-a-list-tp25819794p25819794.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem that you are trying to solve?
More information about the R-help