[R] Sequence generation in a table

Liviu Andronic landronimirc at gmail.com
Thu Dec 9 13:03:02 CET 2010


On Thu, Dec 9, 2010 at 12:41 PM, Vincy Pyne <vincy_pyne at yahoo.ca> wrote:
> The biggest constraint for me is here as an example I have taken only three cases i.e. c(257, 520, 110), however in reality I will be dealing with no of cases and that number is unknown. But your code will certainly generate me the required numbers. In above case for doing further calculations, I can define say
>
> yy1 = as.numeric(yy[[1]])
> yy2 = as.numeric(yy[2]])
> yy3 = as.numeric(yy[[3]])
>
Why do you want to do that? For example,
> mean(yy[[1]])
[1] 157
> mean(yy1)
[1] 157

Liviu



More information about the R-help mailing list