Duncan Murdoch-2 wrote:
>
> ..
> That's because constructing names like this is generally a bad idea.
> But you can do it; you use get() to get the object whose name is in
> temp.name. So put data=get(temp.name) into your lm() call.
>
I had another useful answer (sent privately) from
David.Epstein wrote:
I'm trying to get code along the following lines to work:
temp.name <- paste(TimePt,'df',sep='.') # invent a relevant name/symbol as a
character string.
assign(temp.name,IGF.df[IGF.df$TPt==TimePt,]) # this works. The relevant
variable is now a data frame
lm(b ~ Strain+BWt+PWt
I'm trying to get code along the following lines to work:
temp.name <- paste(TimePt,'df',sep='.') # invent a relevant name/symbol as a
character string.
assign(temp.name,IGF.df[IGF.df$TPt==TimePt,]) # this works. The relevant
variable is now a data frame
lm(b ~ Strain+BWt+PWt+PanPix, data=temp.nam
3 matches
Mail list logo