Dear List, This may be the fifth time Ive tried to send this to the list so apologies if there are multiple emails.
I need some help getting started with this problem. I have a data frame containing a year of daily stock prices in the following format: Date Open High Low Close 1/15/2000 10 11 8 10 1/16/2000 12 12 10 11 etc.. I want to create a new data frame which shows only the rows where the column value "Open" for 'today' is higher than the column value "High" for the previous day (previous row). How do I loop over each day accessing values from different rows and columns, as is needed here? I have tried 'if' statements but none have worked. Any help appreciated. Regards, Alf Sammassimo Melbourne,Australia ______________________________________________ R-help@stat.math.ethz.ch 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 commented, minimal, self-contained, reproducible code.