[R] strptime command in R

2003-10-28 Thread morozov
Hello all: I have a column of times in format x 16:30:00 16:30:03 16:59:00 etc which I need to convert into time variables and do some operations on. I do the command y-strptime(x,%H:%M:%S). This executes almost istantly (for a column x of length 1000 in Windows, but in Unix, where I run

[R] R performance on Unix

2003-10-28 Thread morozov
Hi I'm observing a huge difference in the performance speed of R on Windows and Unix, even though I know that my Unix machine is much more powerful than my Win machine. In particular, any character processing task is very time consuming on Unix. strptime(x,%H:%M:%S) is about 10 times slower on

[R] indexing a vector

2003-10-02 Thread morozov
Dear All: I'd like to know how to sort and then index a vector of floats by several levels in R. For example x-rnorm(100) MyLevels-quantile(x,probs=c(0,.5,1)) MyLevels 0% 50%100% -2.11978442 -0.03770613 2.00186397 next i want to replace each x[i] in x by 1,2,3 or 4