] On
Behalf
Of Göran Broström
Sent: Tuesday, December 31, 2013 4:10 PM
To: r-help@R-project.org
Subject: Re: [R] seq_len and loops
Thanks for the answers from Duncan, Bill, Gabor, and Henrik. You
convinced me that
1. The solution
if (x 1){
for (x in 2:x){
...
is the easiest, most effective
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
Of Göran Broström
Sent: Tuesday, December 31, 2013 4:10 PM
To: r-help@R-project.org
Subject: Re: [R] seq_len and loops
Thanks for the answers from Duncan, Bill, Gabor
] On
Behalf
Of Duncan Murdoch
Sent: Saturday, December 21, 2013 3:52 PM
To: Göran Broström; R-help@r-project.org
Subject: Re: [R] seq_len and loops
On 13-12-21 6:50 PM, Duncan Murdoch wrote:
On 13-12-21 5:57 PM, Göran Broström wrote:
I was recently reminded on this list that
Using 1:ncol() is bad
[mailto:r-help-boun...@r-project.org] On
Behalf
Of Duncan Murdoch
Sent: Saturday, December 21, 2013 3:52 PM
To: Göran Broström; R-help@r-project.org
Subject: Re: [R] seq_len and loops
On 13-12-21 6:50 PM, Duncan Murdoch wrote:
On 13-12-21 5:57 PM, Göran Broström wrote:
I was recently
I was recently reminded on this list that
Using 1:ncol() is bad practice (seq_len is designed for that purpose)
(Ripley)
This triggers the following question: What is good practice for
2:ncol(x)? (This is not a joke; in a recursive situation it often makes
sense to perform the calculation
On 13-12-21 5:57 PM, Göran Broström wrote:
I was recently reminded on this list that
Using 1:ncol() is bad practice (seq_len is designed for that purpose)
(Ripley)
This triggers the following question: What is good practice for
2:ncol(x)? (This is not a joke; in a recursive situation it often
On 13-12-21 6:50 PM, Duncan Murdoch wrote:
On 13-12-21 5:57 PM, Göran Broström wrote:
I was recently reminded on this list that
Using 1:ncol() is bad practice (seq_len is designed for that purpose)
(Ripley)
This triggers the following question: What is good practice for
2:ncol(x)? (This is
What about
seq_len2 - function(length.out, from=1L) {
seq(from=from, length.out=max(0L, length.out-from+1L))
}
lapply(0:4, FUN=seq_len2, from=2L)
[[1]]
integer(0)
[[2]]
integer(0)
[[3]]
[1] 2
[[4]]
[1] 2 3
[[5]]
[1] 2 3 4
/Henrik
On Sat, Dec 21, 2013 at 2:57 PM, Göran Broström
8 matches
Mail list logo