[R] Matrix to Vector

2010-06-15 Thread George Coyle
Hi All, I am trying to turn a Matrix into a vector for analysis purposes. I need to select only certain columns from the entire matrix for the vector (intraday time intervals). Also I need to transpose the Matrix (so times are in rows) stack each successive new column on top of each other (lates

[R] Nested if help

2010-07-16 Thread George Coyle
Hello, I am trying to find a direct way to write a nested if of sorts to find data for a specific time range for a specific day (across a range of days) and have exhausted my abilities with the manuals I have at hand. I have a good deal of data of this approximate form: day time price 1

[R] If statements for multiple arrays

2010-09-16 Thread George Coyle
Hello, I wrote this code which works fine on a single observation: x<-100 y<-200 z<-125 aa<-150 if(xz) {aa-z} result: 25 I am trying to apply this logic where x,y,z,and aa are arrays but with very little success. I have tried using loops and whiles but I always get errors of various types. I h

[R] Converting a line by line program into an array to perform summary stats

2010-09-29 Thread George Coyle
I am trying to turn several lines of information into a variable. I used the filx function to input my file then the readlines to qualify what I want. Essentially I have data in a file every 10 minutes through a day for several years down a column: date time value 9/28/10 02:00 13 9/28/10 0