[R] normalizing prizes to a specific year - how to?

2011-01-27 Thread Martin Hvidberg
-- */ Martin Hvidberg Tanggårdsvej 22 2680 Solrød tlf.: 35 83 01 91 email: mar...@hvidberg.net /* [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] Using sample() with a data frame ?

2008-08-25 Thread Martin Hvidberg
I have a data frame (daf1), that holds +8 records, and 10 variables (i.e. 10 columns and some 8 rows) length(daf1) [1] 10 length(daf1[,1]) [1] 83805 I would like to sample() e.g. 1 records from this. I use: daf2 - sample(daf1, 1000, replace = FALSE, prob = NULL) Error in

[R] Converting a 'difftime' to integer - How to???

2008-05-21 Thread Martin Hvidberg
I want to find the DOY (Day of Year) of some dates. I think to substract the date 1. January from the data to achive this. Something like: d - as.Date(2006-03-13) - as.Date(2006-01-01) +1 d Time difference of 72 days So far so good. But d is a 'difftime' object. How do I get an Integer value