Re: [R] Matching a vector with a matrix row

2011-04-22 Thread Niels Richard Hansen
. -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor Email: niels.r.han...@math.ku.dk Department of Mathematical Sciences nielsrichardhan...@gmail.com University of Copenhagen Skype: nielsrichardhansen.dk

Re: [R] set.seed ( ) function

2011-04-22 Thread Niels Richard Hansen
]] __ 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 commented, minimal, self-contained, reproducible code. -- Niels Richard Hansen

Re: [R] Seeking help re: ? single apply command or an alternative

2011-04-21 Thread Niels Richard Hansen
, reproducible code. On 21/04/11 23.34, Min-Han Tan wrote: -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor Email: niels.r.han...@math.ku.dk Department of Mathematical Sciences nielsrichardhan...@gmail.com University

Re: [R] cube root

2011-04-16 Thread Niels Richard Hansen
-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor Email: niels.r.han

[R] Krylov subspace computations of matrix exponentials

2011-04-14 Thread Niels Richard Hansen
that this permission message and copyright notice appear in all copies. If I choose to use Expokit and just write an interface to R, would there be any problems with having such a copyright notice in the package? Thanks, Niels -- Niels Richard Hansen Web: www.math.ku.dk/~richard

Re: [R] Avoiding a loop

2011-04-08 Thread Niels Richard Hansen
-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor Email: niels.r.han...@math.ku.dk Department of Mathematical Sciences

Re: [R] Lars package

2011-04-07 Thread Niels Richard Hansen
the hood, so there may be a semantic problem in answering that direct question. You can get the full source on any CRAN mirror. -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor Email: niels.r.han...@math.ku.dk Department

Re: [R] cv.lars() function in LARS package

2011-04-07 Thread Niels Richard Hansen
-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 commented, minimal, self-contained, reproducible code. -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate

Re: [R] environment question: changing variables from a formula through model.frame?

2011-01-30 Thread Niels Richard Hansen
. -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor Email: niels.r.han...@math.ku.dk Department of Mathematical Sciences nielsrichardhan...@gmail.com University of Copenhagen Skype: nielsrichardhansen.dk

Re: [R] dataframe: string operations on columns

2011-01-18 Thread Niels Richard Hansen
On 2011-01-18 08:14, Ivan Calandra wrote: Hi, I guess it's not the nicest way to do it, but it should work for you: #create some sample data df- data.frame(a=c(A B, C D, A C, A D, B D), stringsAsFactors=FALSE) #split the column by space df_split- strsplit(df$a, split= ) #place the first

Re: [R] Where is a package NEWS.Rd located?

2011-01-07 Thread Niels Richard Hansen
system. -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor Email: niels.r.han...@math.ku.dk Department of Mathematical Sciences nielsrichardhan...@gmail.com University of Copenhagen Skype

Re: [R] How to bin/average time points?

2010-11-25 Thread Niels Richard Hansen
Hi Kevin Here is one way: yourData - c(0.730, 0.732, 0.743, 0.757,0.781, 0.731, 0.830, 0.832, 0.843, 0.857, 0.881, 0.831) nrGroups - 2 lengthGroups - 6 tapply(yourData, factor(rep(c(1,nrGroups), each = lengthGroups)), mean) and you will have to adjust the number of groups and if necessary

Re: [R] interactive session

2010-09-30 Thread Niels Richard Hansen
-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor Email: niels.r.han...@math.ku.dk Department of Mathematical Sciences

Re: [R] interactive session

2010-09-30 Thread Niels Richard Hansen
(?); a-readLines(n=1) hey b-paste(t,a,sep=)} However, there's a catch {cat(?); a-readLines(n=1) + hey + b-paste(t,a,sep=)} ?ada b [1] tada Notice that the hey doesn't print. -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor

[R] drop.terms and [.terms ignores intercept

2010-09-29 Thread Niels Richard Hansen
Dear R-help list The functions drop.terms and [.terms ignores if the intercept has been explicitly removed. Is that a deliberate feature? For instance, drop.terms(terms(~a+b-1),1) terms(~a+b-1)[2] R version 2.12.0 Under development (unstable) (2010-09-13 r52905) Best, Niels -- Niels Richard

Re: [R] drop.terms and [.terms ignores intercept

2010-09-29 Thread Niels Richard Hansen
On 29/09/10 11.13, peter dalgaard wrote: On Sep 29, 2010, at 10:29 , Niels Richard Hansen wrote: The functions drop.terms and [.terms ignores if the intercept has been explicitly removed. Is that a deliberate feature? Perhaps rather an unimplemented one. The root cause is that both

[R] The permutation of one vector into another

2010-09-16 Thread Niels Richard Hansen
that compute this permutation. Is there such a function doing this -- perhaps more efficiently than the above? For those interested, I need the permutation to bring the rows of a data frame into the same order as the levels of a factor. Thanks, Niels -- Niels Richard Hansen Web

Re: [R] The permutation of one vector into another

2010-09-16 Thread Niels Richard Hansen
match(b, a) ? Michael Right! Thanks, Michael. On 16 September 2010 17:13, Niels Richard Hansen niels.r.hansen+li...@math.ku.dk wrote: Dear R-help-list I have two character vectors a - c(A, B, C) b - c(A, C, B) Then sapply(a, function(i) grep(i, b)) computes the permutation

[R] 'seq' help page: seq_length - seq_len?

2010-09-03 Thread Niels Richard Hansen
In the Value section of the 'seq' help page it says 'seq_along' and 'seq_length' always return an integer vector. I believe it should be 'seq_along' and 'seq_len' always return an integer vector. as there are no seq_length function? Best, Niels -- Niels Richard Hansen

Re: [R] Using termplot() with transformations of x

2010-08-27 Thread Niels Richard Hansen
is intended for the recipient only and should not be forwarded, distributed or otherwise read by others without express permission. The views expressed in this email are not necessarily those of the University of the Sunshine Coast. -- Niels Richard Hansen Web: www.math.ku.dk

[R] Problem with terms of the form (a 1) and subsetting of a terms object

2010-08-26 Thread Niels Richard Hansen
1 2 1 1 3 1 1 ... Taking terms(form)[1] extracts the formula with only the first term, but the parentheses are thrown away, and after the update, I get a different formula. Is that supposed to be so? Thanks, Niels -- Niels Richard Hansen

Re: [R] Problem with terms of the form (a 1) and subsetting of a terms object

2010-08-26 Thread Niels Richard Hansen
, or is the behavior below unexpected? Best, Niels I hope it helps. Best, Dimitris On 8/26/2010 9:17 AM, Niels Richard Hansen wrote: I have the following problem mydata - data.frame(a=1:3) form - ~ (a1) - 1 model.matrix(form,mydata) a 1FALSE a 1TRUE 1 1 0 2 0 1 3 0 1 ... However model.matrix

Re: [R] Passing arguments between S4 methods fails within a function:bug? example with raster package.

2010-08-26 Thread Niels Richard Hansen
.') } } ) -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor Email: niels.r.han...@math.ku.dk Department of Mathematical Sciences nielsrichardhan...@gmail.com University of Copenhagen

Re: [R] Passing arguments between S4 methods fails within a function:bug? example with raster package.

2010-08-26 Thread Niels Richard Hansen
On 26/08/10 18.42, Martin Morgan wrote: On 8/26/2010 8:43 AM, Niels Richard Hansen wrote: setGeneric(myplus,function(x,y,...) standardGeneric(myplus)) setMethod(myplus,c(x=numeric,y=numeric), function(x,y,z=0) x+y+z ) setMethod(myplus,c(x=numeric,y=list), function(x,y,...) callGeneric(x

[R] Slow indexing access for Matrix

2009-02-23 Thread Niels Richard Hansen
. Thanks, Niels -- Niels Richard Hansen Associate Professor Department of Mathematical Sciences University of Copenhagen Universitetsparken 5 2100 Copenhagen Ø Denmark +45 353 20783 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] Meaning of .local and the special token ..1 returned from match.call

2009-02-19 Thread Niels Richard Hansen
-argument? Thanks for any help, Niels -- Niels Richard Hansen Associate Professor Department of Mathematical Sciences University of Copenhagen Universitetsparken 5 2100 Copenhagen Ø Denmark +45 353 20783 __ R-help@r-project.org mailing list https

Re: [R] Support vector model?

2008-12-12 Thread Niels Richard Hansen
the right model. I am very grateful for any help / advice anyone can think of Thank you very much Celine -- Niels Richard Hansen Associate Professor Department of Mathematical Sciences University of Copenhagen Universitetsparken 5 2100 Copenhagen Ø Denmark +45 353 20783

Re: [R] how to test for the empty set

2008-11-25 Thread Niels Richard Hansen
. -- Niels Richard Hansen Associate Professor Department of Mathematical Sciences University of Copenhagen Universitetsparken 5 2100 Copenhagen Ø Denmark +45 353 20783 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE