[R] Line breaks in documentation \useage

2013-01-17 Thread Markku Karhunen
Hi again, R community. I wonder how you do line breaks in \useage{} section in .Rd files. I am sure there's some tutorial for this somewhere, but I just haven't found it. I have tried \\, \cr, \br and \newline, admittedly arbitrarily, but all of these produce warnings or errors. br,

Re: [R] Loss of dimensions in subsetting arrays

2012-10-13 Thread Markku Karhunen
Ok, apologies. On Oct 12, 2012, at 2:52 AM, Markku Karhunen wrote: Hi all, I've been wondering for a long time why R drops the dimensions of an array/matrix when you try to take a subset of one column. I mean this: dim(A) [1] 2 5 2 B=A[1,,] dim(B) 5 2 # so now dim(B)[3] doesn't work

[R] Loss of dimensions in subsetting arrays

2012-10-12 Thread Markku Karhunen
rid of this by writing as.matrix, as.array(...) but that generates extra lines of code. This is really annoying. Does anybody know how to turn this behaviour off? best, Markku Karhunen Uni. Helsinki __ R-help@r-project.org mailing list https

[R] Regularized logistic regression

2011-06-21 Thread Markku Karhunen
Hi Community, I would like to do regularized logistic regression, e.g. lasso, plasso or ridge regression. Can you recommend any packages? Low memory requirement / computational cheapness would be a plus. Markku Karhunen Uni. Helsinki __ R-help

Re: [R] 0 x 0 matrix

2009-09-05 Thread Markku Karhunen
On 04-Sep-09 10:45:27, Markku Karhunen wrote: True. Should have read ?diag. However, this provokes a more general question: Is there some way I can declare some scalar and _all its functions_ as matrices? For instance, I would like to A = as.matrix(0.98) B = function(A) C = diag(sqrt(B

[R] 0 x 0 matrix

2009-09-04 Thread Markku Karhunen
Hi, Does anybody know, what is going on here? diag(sqrt(1)) [,1] [1,]1 diag(sqrt(0.)) 0 x 0 matrix sqrt(1) [1] 1 sqrt(0.) [1] 0.5773214 BR, Markku Karhunen researcher University of Helsinki __ R-help@r-project.org mailing

Re: [R] 0 x 0 matrix

2009-09-04 Thread Markku Karhunen
True. Should have read ?diag. However, this provokes a more general question: Is there some way I can declare some scalar and _all its functions_ as matrices? For instance, I would like to A = as.matrix(0.98) B = function(A) C = diag(sqrt(B)) so that all scalars are explicitly [1,1]

Re: [R] ODE's in R

2008-01-23 Thread Markku Karhunen
Thank you all. We must think about implementing these packages. In the meantime, I should clarify my question: Is there any evidence that doing the dumb for loop discretisation is any more dangerous in R, than in any other language? Apparently not? Best, Markku Karhunen have you looked

[R] ODE's in R

2008-01-22 Thread Markku Karhunen
nasty orbits. Best, Markku Karhunen National Public Health Institute, Finland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] ODE's in R

2008-01-22 Thread Markku Karhunen
Thanks, Dr. Maechler. No, there's no such track. [ Matlab users coming to R may produce wrong R code by using 0:n-1 instead of 0:(n-1) ; but I don't assume this would be the case ] Been there, done that! MK We use just a simple discretisation written in a for loop MK and a