[R] subsetting lists....

Eric Berger er|cjberger @end|ng |rom gm@||@com
Mon Jun 18 13:18:30 CEST 2018


 sapply( 1:length(YH), function(i) { YH[[i]][iuhV[i]]})

On Mon, Jun 18, 2018 at 1:55 PM, akshay kulkarni <akshay_e4 using hotmail.com>
wrote:

> dear members,
>                             I have list YH and index vector iuhV. I want
> to select iuhV[1] from YH[[1]], iuhv[2] from YH[[2]], iuhv[3] from
> YH[[3]]......iuhv[n] from YH[[n]]...
>
> How to do this?
> I searched SO and the internet but was bootless....
>
> Very many thanks for your time and effort.....
> Yours sincerely,
> AKSHAY M KULKARNI
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using 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.
>

	[[alternative HTML version deleted]]




More information about the R-help mailing list