В Mon, 24 Jun 2024 20:16:46 +0800
Steven Yen <st...@ntu.edu.tw> пишет:

> In the call to ame.bopa in a loop, I like inputs in the call to 
> ame.bopa to be bop1, bop2, bop3,... Thanks.
> 
> for (im in 1:m) {
> ame<-ame.bopa(bop,y1.level=y1value,y2.level=y2value,jindex=jindex1,vb.method="invH",joint12=TRUE,
>                  printing=FALSE,testing=TRUE)
> }

Use get(paste0('bop', im)) to read a variable named paste0('bop', im).

If you used a list like suggested by Rui, you would be able to use the
same syntax for read and write access, namely, bop[[im]], instead of
manually assigning variables using assign(name, value) and manually
reading variables using get(name).

-- 
Best regards,
Ivan

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to