Re: [R] for loop not working

2015-10-13 Thread mnw
Thank you for your comments. I guess what I need is to store movements and then loop through that matrix. Here is a snippet of the 'movement' code. I am trying to fill the matrix below with data from this loop. Is there something else my matrix (bottom) requires? Or its positioning? Many thanks,

Re: [R] for loop not working

2015-10-10 Thread David L Carlson
versity -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon Sent: Saturday, October 10, 2015 6:04 AM To: mnw Cc: r-help mailing list Subject: Re: [R] for loop not working Hi mnw, It looks to me as though you are testing the entire "holder&quo

Re: [R] for loop not working

2015-10-10 Thread Jim Lemon
Hi mnw, It looks to me as though you are testing the entire "holder" list each time you go through the function. First, I'm not sure that a simple "==" is the test you want. "movement" seems to be more than a single value and so you might want to write a function that tests whether all of the compo

[R] for loop not working

2015-10-09 Thread mnw
Hi. I have some code which loops through raw GPS data. This initial loop calculates distance, angle, speed etc between successive coordinates as well as type of movement e.g.left, right, forward. I want to construct a second loop that goes through the movements and records 'Changes' as either '0' o

Re: [R] for loop not working

2012-12-25 Thread arun
#your code identical(res1,res2) #[1] TRUE From: eliza botto To: "smartpink...@yahoo.com" Cc: "r-help@r-project.org" ; kri...@ymail.com Sent: Tuesday, December 25, 2012 1:57 AM Subject: RE: [R] for loop not working Dear Arun, as usuall y

Re: [R] for loop not working

2012-12-25 Thread eliza botto
Dear Arun, thank-you very much. i m extremely sorry for spoiling your Christmas. eliza > Date: Tue, 25 Dec 2012 08:51:05 -0800 > From: smartpink...@yahoo.com > Subject: Re: [R] for loop not working > To: eliza_bo...@hotmail.com > CC: r-help@r-project.org; kri...@ymail.co

Re: [R] for loop not working

2012-12-24 Thread arun
7,function(i) mat1[,seq(i,444,37)]) A.K. - Original Message - From: eliza botto To: "r-help@r-project.org" Cc: Sent: Tuesday, December 25, 2012 12:03 AM Subject: [R] for loop not working dear R family,i have a matrix of 444 columns. what i want to do is the following.

Re: [R] for loop not working

2012-12-24 Thread Pascal Oettli
but it never worked. thanks for your kind help. lots of love elisa > Date: Mon, 24 Dec 2012 22:40:08 -0800 > From: smartpink...@yahoo.com > Subject: Re: [R] for loop not working > To: eliza_bo...@hotmail.com > CC: r-help@r-project.org; kri...@ymail.com > > HI Eliz

Re: [R] for loop not working

2012-12-24 Thread eliza botto
martpink...@yahoo.com > Subject: Re: [R] for loop not working > To: eliza_bo...@hotmail.com > CC: r-help@r-project.org; kri...@ymail.com > > HI Eliza, > > You could try this: > set.seed(15) > mat1<-matrix(sample(1:2000,1776,replace=TRUE),ncol=444) > colnames(mat1)

Re: [R] for loop not working

2012-12-24 Thread Pascal Oettli
. any thoughts?? eliza > Date: Tue, 25 Dec 2012 14:12:01 +0900 > From: kri...@ymail.com > To: eliza_bo...@hotmail.com > CC: r-help@r-project.org > Subject: Re: [R] for loop not working > > Hello, > > ?seq > > seq(i,444,37) > > with i = 1,2,3...3

Re: [R] for loop not working

2012-12-24 Thread eliza botto
rg > Subject: Re: [R] for loop not working > > Hello, > > ?seq > > seq(i,444,37) > > with i = 1,2,3...37 > > HTH > Pascal > > > Le 25/12/2012 14:03, eliza botto a écrit : > > > > dear R family,i have a matrix of 444 columns. what i want

Re: [R] for loop not working

2012-12-24 Thread Pascal Oettli
Hello, ?seq seq(i,444,37) with i = 1,2,3...37 HTH Pascal Le 25/12/2012 14:03, eliza botto a écrit : dear R family,i have a matrix of 444 columns. what i want to do is the following. 1. starting from column 1 i want to select every 37th column on the way. more precisely i want to select c

[R] for loop not working

2012-12-24 Thread eliza botto
dear R family,i have a matrix of 444 columns. what i want to do is the following. 1. starting from column 1 i want to select every 37th column on the way. more precisely i want to select column 1, 38,75,112,149 and so on. 2.starting from column 2, i again want to select every 37th column. which