Hello,
A good example of a use case of seq_along is to avoid constructs such as
1:length(x) that don't make sense and are a source for bugs whenever x
is of length zero. See for instance loops where careless coders do
for(i in 1:length(x)){
x[i] <- some computation
}
If x is of lengt
Hi Jeff
I have seen the seq_along function but never knew the what or why of it. Your
response is much appreciated and just shows how brilliant the creators of R
were/are.
Thank you for enlightening me. Carl Sutton
On Friday, April 14, 2017 3:54 PM, Jeff Newmiller
wrote:
Have you eve
Have you ever used the seq_along() function?
If you want to delegate the decision of how many elements you want to process
to some earlier point in your (or someone else's) code, then the most logical
way to create a result vector that is the same size as some input vector, even
if that vector
Hi
just messing around today and am now perplexed by the seq argument
"along.with".
Please, I am just just seeking some knowledge here. Obviously I missed a point
and would like to know what it is.
seq(1,10,length.out = 2) makes sense
seq(1,10,by = 2) makes sense
seq(1,10, along.wi
4 matches
Mail list logo