search for: yday

Displaying 20 results from an estimated 107 matches for "yday".

Did you mean: day
2005 Jul 23
2
link_stat
...et up my company's back up server using rsync. And I've got a strange problem. I searched in the archives of this list, but none of them seems not giving me an idea to solve the problem. If anyone can help, it would be grateful. I'm using cron by a user (non wheel/admin) to rsync everyday during the night. The cron is set in the server to transfer the backing-up directories to a remote server. My shell script is as follows. I make up the proper command by the script. The user is authenticated by RSA non password. The problem is, I can run successfully with the command, which...
2007 Mar 21
1
bug and patch: strptime first-of-month error in (possibly unsupported use of) "%j" format (PR#9577)
...me(1 + cumsum(c(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30)), "%j") [1] NA NA NA NA NA NA NA NA NA NA NA > The problem is an edge-case comparison in datetime.c:glibc_fix(). This generates a date like "Jan 32", which validate_tm() catches and NAs. (Values of field tm->tm_yday start at 0, not 1.) ================================================================================= PATCH: --- R/src/main/datetime.c (revision 40860) +++ R/src/main/datetime.c (working copy) @@ -796,7 +796,7 @@ if(tm->tm_yday != NA_INTEGER) { /* since we have yday, let that take preced...
2010 Oct 01
3
Converting a dataframe column from string to datetime
...1] "2010-02-05 20:00:01.43" [[2]] [1] "2010-02-05 20:00:02.274" [[3]] [1] "2010-02-05 20:00:02.274" [[4]] [1] "2010-02-05 20:00:06.34" However, when I do an unlist...I gets converted to something like this... sec min hour mday mon year wday yday isdst sec min hour mday mon year wday yday isdst sec 1.430 0.000 20.000 5.000 1.000 110.000 5.000 35.000 0.000 2.274 0.000 20.000 5.000 1.000 110.000 5.000 35.000 0.000 2.274 min hour mday mon year wday yday isdst sec mi...
2006 Jan 22
23
calculate users age
i know it''s probably really simple, how do i work out someone''s age if i have their d.o.b. stored as a date in my db. cheers -- Posted via http://www.ruby-forum.com/.
2007 Jan 17
2
problem with unlist POSIX date at midnight
...od[16]) is not the solution.... begin=paste(dates[i]-1,"09:00:00") end=paste(dates[i],"08:00:00") acc.period=seq(as.POSIXct(begin),as.POSIXct(end),"hour") unlist(strptime(acc.period[16],format="%Y-%m-%d %H:%M:%S")) # sec min hour mday mon year wday yday isdst # NA NA NA NA NA NA NA NA -1 unlist(strptime(acc.period[17],format="%Y-%m-%d %H:%M:%S")) # sec min hour mday mon year wday yday isdst # 0 0 1 1 2 106 3 59 0 a="2006-03-01 00:00:00" unlist(strptime(a,for...
2008 Dec 11
3
getting ISO week
....POSIXlt(Y) Y<-as.numeric(format(date.posix,"%Y")) M<-as.numeric(format(date.posix,"%m")) D<-as.numeric(format(date.posix,"%d")) } LY<- (Y%%4==0 & !(Y%%100==0))|(Y%%400==0) LY.prev<- ((Y-1)%%4==0 & !((Y-1)%%100==0))|((Y-1)%%400==0) date.yday<-date.posix$yday+1 jan1.wday<-strptime(paste(Y,"01-01",sep="-"),"%Y-%m-%d")$wday jan1.wday<-ifelse(jan1.wday==0,7,jan1.wday) date.wday<-date.posix$wday date.wday<-ifelse(date.wday==0,7,date.wday) ####If the date is in the beginning, or end of...
2007 Apr 20
1
sequential for loop
...mfortable using the *apply functions for vectorizing loops in R. However, my particular problem now is using it in a sequential operation, which uses values evaluated in an offset of the loop vector. Here is my example using a for loop approach: dat <- data.frame(year=rep(1970:1980,each=365),yday=1:365) dat$value <- sin(dat$yday*2*pi/365)+rnorm(nrow(dat),sd=0.5) dat$ca <- dat$cb <- 0 # consecutive above and below 0 for(n in 2:nrow(dat)){ if(dat$value[n] > 0) dat$ca[n] <- dat$ca[n-1] + 1 else dat$cb[n] <- dat$cb[n-1] + 1 } I'm inquiring if there is a strai...
2005 Oct 06
2
isdst
Can someone, please, explain the difference is results below (notice the isdst value) > unlist(as.POSIXlt('2005-7-1')) sec min hour mday mon year wday yday isdst 0 0 0 1 6 105 5 181 1 > unlist(as.POSIXlt(as.Date('2005-7-1'))) sec min hour mday mon year wday yday isdst 0 0 0 1 6 105 5 181 0
2007 Dec 11
3
Wrong length of POSIXt vectors (PR#10507)
...12L, 12L, 12L, 12L, 12L, 12L, NA, 12L, 12L, 12L), mday = c(13L, 13L, 13L, 13L, 13L, 13L, 13L, NA, 13L, 13L, 13L), mon = c(5L, 5L, 5L, 5L, 5L, 5L, 5L, NA, 5L, 5L, 5L), year = c(105L, 105L, 105L, 105L, 105L, 105L, 105L, NA, 105L, 105L, 105L), wday = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, NA, 1L, 1L, 1L), yday = c(163L, 163L, 163L, 163L, 163L, 163L, 163L, NA, 163L, 163L, 163L), isdst = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, -1L, 1L, 1L, 1L)), .Names = c("sec", "min", "hour", "mday", "mon", "year", "wday", "yday", "isdst"...
2003 Aug 13
1
Problems with addition in big POSIX dates
Have you noticed any problems with big dates (>=1/1/2040) in R? Here is the bit of code that I'm having trouble with: > test.date <- strptime("1/1/2040",format="%m/%d/%Y") > > unlist(test.date) sec min hour mday mon year wday yday isdst 0 0 0 1 0 140 0 0 0 > > date.plus.one <- as.POSIXct(test.date) + 24*60*60 > date.plus.one.lt <- as.POSIXlt(date.plus.one) > > unlist(date.plus.one.lt) sec min hour mday mon year wday yday isdst 0 0 0 2...
2010 Dec 27
1
Can't merge on datetime?
...10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L), year = c(110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L), wday = c(1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L), yday = c(304L, 305L, 306L, 307L, 308L, 311L, 312L, 313L, 314L, 315L, 318L, 319L, 320L, 321L, 322L, 325L, 326L, 327L, 328L, 329L, 332L), isdst = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L)), .Names = c("sec", "min", "hour", &quot...
2013 Dec 02
1
Days to solstice calculation
...Yr),as.character(rep("-12-31", length(Yr))),sep = "")) Winter <- NA Summer <- NA for (g in 1: length(a)){ if(is.na(a[g])== FALSE){ if(is.na(b[g])== FALSE){ cc <- seq.int(a[g],b[g], by = '1 day') d <- length(cc) e <- strptime(cc, "%Y-%m-%d")$yday+2 f <- Daylength(e,39.6981478) Winter[g] <- which.min(f) Summer[g] <- which.max(f) } } if(is.na(a[g])== TRUE){ Winter[g] <- NA Summer[g] <- NA } if(is.na(b[g])== TRUE){ Winter[g] <- NA Summer[g] <- NA } } #Days until solstice if (solstice =='S'){Countdown...
2020 Oct 23
2
The presence/absence of `zone` in POSIXlt depending on time zone as a cause of possible inconsistences?
...Xlt time with a non GMT zone (also non specifying tz if the Sys.timezone is not GMT) gets a character vector due to including the `zone` element. > x <- as.POSIXlt(Sys.time(), "GMT") > (y <- unlist(x)) sec min hour mday mon year wday yday isdst 54.99715 26.00000 16.00000 23.00000 9.00000 120.00000 5.00000 296.00000 0.00000 > str(y) Named num [1:9] 55 26 16 23 9 ... - attr(*, "names")= chr [1:9] "sec" "min" "hour" "mday" ... > x <- as.POSIXlt(Sys.time(), &quo...
2009 Feb 27
0
POSIXlt, POSIXct, strptime, GMT and 1969-12-31 23:59:59
...havior, that I can't seem to find documented. Sys.setenv(TZ="GMT") str(unclass(strptime("1969-12-31 23:59:59","%Y-%m-%d %H:%M:%S"))) List of 9 $ sec : num 59 $ min : int 59 $ hour : int 23 $ mday : int 31 $ mon : int 11 $ year : int 69 $ wday : int 3 $ yday : int 364 $ isdst: int 0 - attr(*, "tzone")= chr "GMT" # setting to 59 seconds now reports 0 str(unclass(as.POSIXlt("1969-12-31 23:59:59"))) List of 9 $ sec : num 0 $ min : int 59 $ hour : int 23 $ mday : int 31 $ mon : int 11 $ year : int 69 $ wday : int...
2008 Mar 31
3
UK Daylight Savings
A quick fix for anyone running into this problem: load_schedule was crashing cron_trigger.rb#160, and I found that for triggers like "0 20 5 * * * *" it was putting in 32 for the date (even though its Mon Mar 31 04:16:21 BST 2008). Something to do with switching to day light savings I think, which concludes after 2am. I patched it by adding day = 31 if day == 32 on the line before.
2010 May 19
0
A revised function for getting ISO week
....POSIXlt(Y) Y<-as.numeric(format(date.posix,"%Y")) M<-as.numeric(format(date.posix,"%m")) D<-as.numeric(format(date.posix,"%d")) } LY<- (Y%%4==0 & !(Y%%100==0))|(Y%%400==0) LY.prev<- ((Y-1)%%4==0 & !((Y-1)%%100==0))|((Y-1)%%400==0) date.yday<-date.posix$yday+1 jan1.wday<-strptime(paste(Y,"01-01",sep="-"),"%Y-%m-%d")$wday jan1.wday<-ifelse(jan1.wday==0,7,jan1.wday) date.wday<-date.posix$wday date.wday<-ifelse(date.wday==0,7,date.wday) ####If the date is in the beginning, or end of...
2013 Mar 19
1
Convert to date and time of the year
...r R Users, I have data for more than 3 years. For each year I want to find the day corresponding to Jaunary 1 of that year. For example: > x <- c('5/5/2007','12/31/2007','1/2/2008') > #Convert to day of year (julian date) - > strptime(x,"%m/%d/%Y")$yday+1 [1] 125 365 2 I want to know how to do the same thing but with time added. But I still get the day not time. Can anyone suggest what is the better way to find the julian date with date and time ? > x1 <- c('5/5/2007 02:00','12/31/2007 05:58','1/2/2008 16:25') &...
2020 Oct 01
3
timezone tests and R-devel
...(2020-10-01 r79286) I get > x = Sys.time() > attributes(x) $class [1] "POSIXct" "POSIXt" > attributes(as.POSIXlt(x)) $names [1] "sec" "min" "hour" "mday" "mon" "year" "wday" "yday" [9] "isdst" "zone" "gmtoff" $class [1] "POSIXlt" "POSIXt" $tzone [1] "US/Eastern" "EST" "EDT" > all.equal(x, as.POSIXlt(x)) [1] TRUE On R Under development (unstable) (2020-10-01 r79286) I get &g...
2002 Apr 11
6
extract week from date
Hello R-users, Does anyone know how obtain the week of a date? (in SPPS the instruction is "xdate.week") Thanks, Juan Ramon -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the
2011 Feb 19
1
problem in plotting numeric x by POSIXt class with lattice
...0L, 0L), year = c(100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100), wday = c(3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L), yday = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), isdst = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L)), .Names = c("sec", "min&quot...