Re: [R] Help with creating some loops

2009-10-30 Thread David Winsemius
On Oct 30, 2009, at 11:24 AM, Vadlamani, Satish {FLNA} wrote: Hi: In general, how to I cast a character to the class that I am trying to change. For example, if I have a data frame df1. df1 has a column x. suppose I want to a substring of x (the first 3 chars). Then I want to do somethi

Re: [R] Help with creating some loops

2009-10-30 Thread Vadlamani, Satish {FLNA}
Hi: In general, how to I cast a character to the class that I am trying to change. For example, if I have a data frame df1. df1 has a column x. suppose I want to a substring of x (the first 3 chars). Then I want to do something like df1$new = substring(of x) Example Data frame df1 x abcd efgh

[R] Help with creating some loops

2009-10-30 Thread Vadlamani, Satish {FLNA}
Hi All: I have a data frame called all_corn. This has 31 columns. The first column is a character key. The next 15 columns (stat1,stat2,...,stat15) are the statistical forecast. The last 15 columns (sls1,sls2,...,sls5) are actual sales. I want to calculate textbook tracking signal and cuulative