Re: [R] execute a script in command line

2010-10-14 Thread Jim Hargreaves
Hi Benoit, Have a look at 'man R'. You want something like 'R CMD BATCH toto.R' (case sensitive). Hope this helps, Jim Hargreaves On 10/14/2010 05:15 PM, Benoit Wastine wrote: Dear all, I'm running R on Linux OS. I want to execute a programme "toto.R&quo

[R] Regex in an IF statement?

2010-07-23 Thread Jim Hargreaves
about if statements. Any help greatly appreciated, Regards, Jim Hargreaves __ 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 commente

[R] Convert Unix (Epoch) timestamp to DD/MM/YY and HH:MM:SS

2010-07-20 Thread Jim Hargreaves
Dear List, After much searching with no success, I would like to ask how I can convert a unix/POSIX time (seconds since Jan 01, 1970) into a string like "01/01/1970 00:00" This is probably easily done with a system(date...) but it would be great if I could do it in R. Kind Re

[R] Apply a shift which is a function of the array.

2010-07-02 Thread Jim Hargreaves
ed to modify this so that the argument to shift is dependent on the column the shift is being applied to. Any suggestions would be greatly appreciated! Kind Regards, Jim Hargreaves __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

Re: [R] Recursive indexing failed at level 2

2010-06-26 Thread Jim Hargreaves
On 06/26/2010 02:07 PM, Duncan Murdoch wrote: Jim Hargreaves wrote: Hi Duncan, list, Thanks for the advice, but unfortunately that wasn't what was causing my problem. I'm still getting the "Recursive indexing failed at level 2" message even after replacing my unlist(pul

Re: [R] Recursive indexing failed at level 2

2010-06-26 Thread Jim Hargreaves
art[i]):as.numeric(peak_end[i])] : recursive indexing failed at level 2 It's almost as if the length of pulse[[i]] is too small, but it's length is 1001 and peak_start[i] and peak_end[i] are 192 and 208 respectively. Also why would the problem crop up only after 200,000 runs? Bizarre! Regards, J

Re: [R] Recursive indexing failed at level 2

2010-06-26 Thread Jim Hargreaves
On 06/26/2010 01:20 PM, Duncan Murdoch wrote: On 26/06/2010 7:53 AM, Jim Hargreaves wrote: Dear fellow R users, I am replacing elements of a list like so: pulse_subset[[1:20]]=unlist(pulse[i])[1:20] If pulse is a list, then pulse[i] is also a list, with one element. I think you want pulse

[R] Recursive indexing failed at level 2

2010-06-26 Thread Jim Hargreaves
t[[1:(length(unlist(pulse[i])[as.numeric(peak_start[i]):as.numeric(peak_end[i])]))]] <- unlist(pulse[i])[as.numeric(peak_start[i]):as.numeric(peak_end[i])] : recursive indexing failed at level 2 If anyone could shed some light I'd be rather gratefu

[R] Replacing elements of a list over a certain threshold

2010-06-21 Thread Jim Hargreaves
Dear List, I have a list of length ~1000 filled with numerics. I need to replace the elements of this list that are above a certain numerical threshold with the value of the threshold. e.g example=list(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) threshold=5 example=(1, 2, 3, 4,