search for: xdates

Displaying 14 results from an estimated 14 matches for "xdates".

Did you mean: dates
2012 Aug 28
3
date in plot, can't add regression line
...40 2 2009-02-12 6 The plot displays the x column as the yaxis and the date as the x axis, grouped by the tradetype column. The timestamp column: > class(tradeflavorbyday$timestamp) [1] "POSIXlt" "POSIXt" So in this case I want to plot tradetype 1 (method 1): xdates <- tradeflavorbyday$timestamp[tradeflavorbyday$tradeflavor == 1] ydata <- tradeflavorbyday$x[tradeflavorbyday$tradeflavor == 1] plot(xdates, ydata, col="black", xlab="Dates", ylab="Count") Up to here it works great. Now a abline through lm: xylm <- lm(ydat...
2009 Mar 25
1
Creating date seq in data frame
Hi, I have the following type of data: myData <- data.frame(x = 1:5, y = letters[1:5], xDate = seq(as.Date("2001/2/1"), as.Date("2005/2/1"), by="year") ) > myData x y xDate 1 a 2001-02-01 2 b 2002-02-01 3 c 2003-02-01 4 d 2004-02-01 5 e 2005-02-01 What I need is a new column, say xDate2, that for each xDate (or for each unique combination of
2019 Mar 06
1
as.Date(Inf) displays as 'NA' but is actually 'Inf'
...more principled code to show the phenomenon, including the fact noticed by Bill that both as.Date() and format.Date() should probably be tweaked such as to signal warnings (e.g. on integer overflow for too large numbers). ## ------------------------------------------------------------------------- xDates <- lapply(c(-Inf, Inf, NA, NaN, 1e9, 4e9, 1e100, .Machine$double.xmax), as.Date, origin = "2000-01-01") str(xDates) # --> first 4 *all* show as NA sapply(xDates, is.na) # the two +-Inf are not NA (f.D <- sapply(xDates, format))# 1..4: NA, then...
2010 Jul 29
2
multiple graphics windows open
Dear R People: Now I have a function with 3 graphics windows. I'd like for them all to be visible. However, the first window goes blank. Here is the basic setup. The first plot is the entire series. The user selects two points, which in turns generates a subset plot and an EWMA subset plot. Finally, if things worked right, the user should be able to click on "Tile Vertically"
2007 Jun 13
5
Confusion with sapply
Hi, I have some confusion in applying a function over a column. Here's my function. I just need to shift non-March month-ends to March month-ends. Initially I tried seq.dates, but one cannot give a negative increment (decrement) here. return(as.Date(seq.dates(format(xdate,"%m/%d/%Y"),by="months",len=4)[4]) ) Hence this simple function: > mydate <-
2010 Aug 01
1
aggregating a daily zoo object to a weekly zoo object
Dear R People: I'm trying to convert a daily zoo object to a weekly zoo object: xdate <- seq(as.Date("2002-01-01"),as.Date("2010-07-10"),by="day") library(zoo) length(xdate) xt <- zoo(rnorm(3113),order=xdate) xdat2 <- seq(index(xt)[1],index(xt)[3113],by="week") xt.w <- aggregate(xt,by=xdat2,mean) Error: length(time(x)) ==
2010 Jul 29
1
multiple graphics windows open with sessionInfo
Dear R People: Hello again. I'm trying to have 3 graphics windows visible simultaneously. I set up a zoo series. Then I plot the original series. I use the locator function to select 2 values from the original series, which generates a subset of the original series. Next, I plot the subset. The last step is to produce an EWMA chart from the subset series. Fair enough. I've tried
2019 Mar 06
2
as.Date(Inf) displays as 'NA' but is actually 'Inf'
Hi Gabriel, The point is that it *visually* displays as NA, but is.na() still responds as FALSE. When I (and I am sure many people) see an NA, we then use is.na(). If we see Inf displayed, we then use is.infinite(). With as.Date() this breaks down. I'm not arguing that as.Date(Inf) should be coerced to NA. I'm arguing that as.Date(Inf) should be *visually* displayed as Inf (i.e. the
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
2015 Nov 06
0
Puzzled by eval
On 06/11/2015 7:36 AM, Therneau, Terry M., Ph.D. wrote: > I am currently puzzled by a seach path behavior. I have a library of a dozen routines > getlabs(), getssn(), getecg(), ... that interface to local repositories and pull back > patient information. All have a the first 6 arguments in common, and immediately call a > second routine to do initial processing of these 6. The
2015 Nov 06
4
Puzzled by eval
I am currently puzzled by a seach path behavior. I have a library of a dozen routines getlabs(), getssn(), getecg(), ... that interface to local repositories and pull back patient information. All have a the first 6 arguments in common, and immediately call a second routine to do initial processing of these 6. The functions "joe" and "fred" below capture the relevant
2014 Jul 04
1
DESCRIPTION.in file causes R CMD check to fail?
hi. i'm building a package using autotools. to propagate the package version number from configure.ac to DESCRIPTION, i'm using a DESCRIPTION.in file. both of these files are "shar"'d below. i need to distribute the DESCRIPTION.in file, as ./configure will need it. but, "R CMD check" wants to look at DESCRIPTION, so i've let that also come into the package
2006 Jan 31
1
retrieving attributes of searchresults
i use the perl interface of Search::Xapian to index documents, now i got metadata i store with the index like title, date, author, .. and i wonder how to retrieve them from the index again without pulling them from the database. i am pretty sure this is a stupid question and that the answer is obvious i dont seem to be able to find it. regards m
2014 Nov 14
1
file.copy
Hello, Here is something (file.copy) trivial but does not seem to work. I could not figure out what I am doing wrong. The R script below creates folders (fromFolder and toFolder) and finds the list of files (list.of.files) to be copied to the toFolder, which I have verified using the print () command. But, the issue is that the file.copy() command does not work. Both the R.script and the