Skip to content
Prev 247649 / 398503 Next

Odp: to append a column to a data frame, has I use loop/if in my case?

Hi

r-help-bounces at r-project.org napsal dne 17.01.2011 15:59:37:
recent
I have no idea what is regular week. Seems to me that you seek some 
rolling maxima for which I suggest to consult package zoo and its function 
rollapply.
days
last 2
max
I do
before
cbind binds together three vectors and makes a matrix. Matrix can have 
only values of only one type. Therefore it strips off days to underlying 
numeric representation. If you want to know more about R objects and their 
properties you could read R intro.
num [1:70, 1:3] 14991 14990 14989 14988 14987 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:3] "days" "price" "regular"

Regards
Petr
http://www.R-project.org/posting-guide.html