[R] Script auto-detecting its own path

2010-09-29 Thread Stu Field
)]]) ~~ Stu Field, PhD Postdoctoral Fellow Department of Biology Colorado State University 1878 Campus Delivery Fort Collins, CO 80523-1878 Office: E208 Anatomy/Zoology Phone: (970) 491-5744 ~~ [[alternative HTML version deleted

Re: [R] Script auto-detecting its own path

2010-09-29 Thread Stu Field
-- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/ ~~ Stu Field, PhD Postdoctoral Fellow Department of Biology Colorado State University 1878 Campus Delivery Fort Collins, CO 80523-1878 Office: E208

[R] Matrix Construction; Subdiagonal

2009-03-11 Thread Stu Field
there is not a simple way to do this... Thanks for your help, ~~ Stu Field, PhD Postdoctoral Fellow Department of Biology Colorado State University 1878 Campus Delivery Fort Collins, CO 80523-1878 Office: E208 Anatomy/Zoology Phone: (970) 491-5744

Re: [R] Matrix Construction; Subdiagonal

2009-03-11 Thread Stu Field
(A) == col(A) + 1] - vec --sundar On Wed, Mar 11, 2009 at 4:42 PM, Stu Field s...@colostate.edu wrote: I'm trying to enter a vector into the subdiagonal of a matrix but cannot find a command in R which corresponds to the MatLab version of diag(vec, k), where vec = the vector of interest

Re: [R] Matrix Construction; Subdiagonal

2009-03-11 Thread Stu Field
] On Behalf Of Sundar Dorai-Raj Sent: Thursday, 12 March 2009 10:00 AM To: Stu Field Cc: r-help@r-project.org Subject: Re: [R] Matrix Construction; Subdiagonal You can always write your own function: myDiag - function(x, vec, k) { x[row(x) == col(x) - k] - vec x } myDiag(A, vec, -1