search for: difftimedate

Displaying 3 results from an estimated 3 matches for "difftimedate".

2009 Jan 27
2
Can I create a timeDate object using only year and week of the year values?
...resent). What I have found so far includes: library(Rmetrics) time1 = timeDate(charvec = Sys.Date(), format = "%Y-%m-%d", zone = "", FinCenter = "") time2 = timeDate("2004-08-30", format = "%Y-%m-%d", zone = "", FinCenter = "") difftimeDate(time1,time2,units = "weeks") Does timeDate use the format strings used by the UNIX date(1) command? If so, then can I safely assume timeDate will accept "%Y-%U-%w", and behave correctly? Thanks, Ted [[alternative HTML version deleted]]
2009 Jan 27
1
Mystery Error in midnightStandard
...r (i in 1:length(V4) ) { x = read.csv(as.character(V4[[i]]), header = FALSE, na.strings=""); y = x[,1]; year = V2[[i]]; week = V3[[i]]; dtstr = sprintf("%i-%i-%i",year,week,dow); date2 = timeDate(dtstr, format = "%Y-%U-%w"); resultsdataframe$dt[[i]] <- difftimeDate(date1,date2,units = "weeks"); fp = fitdistr(y,"exponential"); print(c(V1[[i]],V2[[i]],V3[[i]],fp$estimate,fp$sd)); print(c(year,week,date2,resultsdataframe$dt[[i]])); resultsdataframe$estimate[[i]] <- fp$estimate; resultsdataframe$sd[[i]] <- fp$sd; } It fails wi...
2009 Jan 28
2
t.test in a loop
Hi All, I've been having a little trouble with creating a loop that will run a a series of t.tests for inspection, Below is the code i've tried, and some checks i've looked at. I've used the get(paste()) idea as i was told previously that the use of the eval should try and be avoided. I've run a single syntax to check that my systax is correct and works without any problems