[R] extracted residuals as single column

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Tue Nov 23 12:38:13 CET 2010


On Tue, Nov 23, 2010 at 10:36 AM, Jennifer Dodd <j.dodd at bio.gla.ac.uk> wrote:
> Dear list,
>
>
>
> I am looking for some help with the format of extracted residual values
>
>
>
> output from:
>
>
>
> residuals (model1)
>
>
>
> [1]  0.74140534 0.72464895 0.74873373 0.78313611 0.78836470 0.76934676
> 0.77448847 0.78465077 0.79278282
>
> [10] 0.80852056 0.81442047 0.80890838 0.78335232 0.83127343 0.85895985
> 0.85743700 0.83578769 0.82265972
>
> [19] 0.81611939 0.84459841 0.84346431 0.83469399 0.86057807 0.86379411
> 0.84649222 0.82218322 0.61385728
>
>
>
> how can I change the output to a single column?
>
>
>
> like
>
>
>
> [1]      0.74140534
>
> [2]      0.72464895
>
> [3]      0.74873373
>
> [4]      0.78313611
>
> [5]      0.78836470
>
>
>
> etc...
>

 It's a single row, so to make a single column, transpose it:

t(residuals(model))

 not sure why you'd want to do that though....

Barry



More information about the R-help mailing list