similar to: How to plot line, points, using Dates as X-axis

Displaying 20 results from an estimated 11000 matches similar to: "How to plot line, points, using Dates as X-axis"

2010 Apr 29
1
image function with date-time on X axis
I am trying to plot a image where the x axis has the units of time. When I issue the image(x,y,z) command with x as a POSIXct object, it fails to put a time stamp on the x axis. Instead I get a warning "Incompatible methods" warning and no dates on my x axis. This example shows my problem: Rmat=t(matrix(data=rnorm(1:500),ncol=10,nrow=50)) tax=seq(ISOdate(2010,4,14,12,0,0),
2002 May 28
2
histogramming dates
I'd like to make a plot showing frequency of an event. The data is in a data from that includes Year, Month and Day (of month) fields, so I created a Date with ISOdate(Year, Month, Day, tz=''). I can plot frequencies for the year 2002 with > thisyear <- Date[Year==2002] > hist( thisyear, xaxt='n' ) > axis.POSIXct( 1, at=seq(min(thisyear), max(thisyear),
2003 Jul 26
1
bug plotting dates?
Hello R-experts! I am using R Version 1.7.1 (2003-06-16) on a Debian Linux box and I have discovered an odd result when plotting data involving dates. Please try this minimal example: a = seq(ISOdate(2000,1,1), ISOdate(2001,1,1), "months") b = 1:13 plot(a,b, col="red") What I get is a plot that looks as expected except the x-axis is mostly red. Can anyone reproduce this
2007 Dec 14
3
calculating the number of days from dates
Hello, I gather variants of this question have been asked previously. I have done some reading but only became more confused, as I suspect what I am trying to do is more basic than other applications. The following code readily calculates the difference in days between two dates: newdays <- ISOdate(2005, 5,12) - ISOdate(2006, 12, 22) However, I wanted to be able to deduct the dates in
2003 May 11
1
lines(aline, type = 'b', col = "blue) does not work for POSIXct plot.
Hello, x <- ISOdate(2003, 4, 1:30) # POSIXct vector y <-c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) aline <- c(30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1) plot(x, y, xaxt = 'n', main = 'Number of Stuff for the Project, April 2003', xlab = 'Report Time', ylab = 'Number of
2018 Jan 22
0
Manipulating two large dataset differing by date and time
Hi Ogbos, You can just use ISOdate. If you pass more values, it will process them: ISOdate(2018,01,22) [1] "2018-01-22 12:00:00 GMT" > ISOdate(2018,01,22,18,17) [1] "2018-01-22 18:17:00 GMT" Add something like: if(is.null(data$hour),data$hour<-12 then pass data$hour as it will default to the same value as if you hadn't passed it. Jim On Mon, Jan 22, 2018 at 6:01
2004 Jun 07
7
Vectors of years, months, and days to dates?
The interface for dates in R is a little confusing to me. I want to create a vector of Date objects from vectors of years, months, and days. One solution I found is: years <- c(1991, 1992) months <- c(1, 10) days <- c(1, 2) dates <- as.Date(ISOdate(years, months, days)) But, in this solution the ISOdate function converts the vectors into characters, which can cause serious
2009 Feb 06
2
Plot with x-axis dates
Hello, I am attempting to create plots using two continuous variables and it seems I should be able to use the simple "plot" command. However, my x-axis values are dates, and I believe this could be the reason I am receiving error messages reading: Error in Summary.factor(c(2L, 4L, 3L, 5L, 6L, 7L, 1L), na.rm = FALSE) : range not meaningful for factors I have attempted to
2003 Nov 19
5
ISOdate returns incorrect date?
Dear all, I have found the following (for me) incomprehensible behaviour of ISOdate (POSIXct): > ISOdate(1900,6,16) [1] "1900-06-15 14:00:00 Westeurop?ische Sommerzeit" > ISOdate(1950,6,16) [1] "1950-06-16 14:00:00 Westeurop?ische Sommerzeit" Note that in the first case I get the 15th of June back, not the 16th as I would have expected! This happened under R-1.7.1 on
2007 Mar 05
4
plot(): I want to display dates on X-axis.
Hi, I want to display dates on my x-axis of the plot. I was trying to use plot() command for the same and passing the values in following manner: The variable "dat" is a data frame. The first column has numeric values and second column has date. e.g. dat [,1] dat[,2] [1,] 300 20060101 [2,] 257
2003 Nov 25
0
AW: ISOdate() and strptime()
Thanks for this clarification. I have learned in the meantime that it is necessary to be very careful when using all these POSIX things. As another example, here is something that made me scratch my head just yesterday: When I create a sequence of days that happens to start before and ends in daylight savings time, I seem to lose a day: > seq(from = strptime("20030329",
2016 Apr 18
0
as.Date
The most important thing is that Date objects by definition do not include time of day. You want to look at ISOdatetime() and as.POSIXct() instead. And beware daylight savings time issues. -pd On 18 Apr 2016, at 15:09 , Ogbos Okike <giftedlife2014 at gmail.com> wrote: > Dear All, > > I have a data set containing year, month, day and counts as shown below: > data <-
2008 Apr 10
1
ISOdate/ISOdatetime performance suggestions, other date/time questions
Dear list: working with date/times I have come across a problem that ISOdate and ISOdatetime are too slow on large vectors of data. I was surprised just until I looked at the implementation and the man page: "ISOdatetime and ISOdate are convenience wrappers for strptime". In other terms, they convert data to character representation first in order to create a POSIXlt object that is then
2007 Mar 22
2
difftime / RBloomberg
hi, I've troubles with some difftime objects. e.g. ISOdate(2001, 4, 26) - ISOdate(2001, 2, 26) - 2 works, telling me "Time difference of 57 days". But when I'd like to add days, such as ISOdate(2001, 4, 26) - ISOdate(2001, 2, 26) + 2 the function gives me an error. Function "as.COMDate.chron" of the Rbloomberg package doesn't work for that reason. I'm
2016 Apr 18
0
as.Date: fixed
Dear All, Many thanks for bailing me out. Ogbos On Apr 18, 2016 9:07 PM, "David Winsemius" <dwinsemius at comcast.net> wrote: > > > On Apr 18, 2016, at 10:44 AM, Ogbos Okike <giftedlife2014 at gmail.com> > wrote: > > > > Dear ALL, > > Thank you so much for your contributions. > > I have made some progress. Below is a simple script I
2003 Nov 14
5
ISOdate() and strptime()
Dear R-people! I am using R 1.8.0, under Windows XP. While using ISOdate() and strptime(), I noticed the following behaviour when "wrong" arguments (e.g., months>12) are given to these functions: > ISOdate(year=2003,month=2,day=20) #ok [1] "2003-02-20 13:00:00 Westeurop?ische Normalzeit" > ISOdate(year=2003,month=2,day=30) #wrong day, but returns a value [1]
2002 Nov 04
0
persp(), x- and y-axis with character strings
Dear R list, I want to plot the yield curve in a 3D graph: the x-axis refers to time; the y-axis refers to the maturities and the z-axis are the yields. The following code works fine: persp(y, x, as.matrix(ypper), xlab="Last 50 periods", ylab="Maturities (months)",zlab="Yields", zlim=c(3,6),theta=130, phi=15, col="Seagreen", box=T,
2016 Apr 18
1
as.Date
Dear ALL, Thank you so much for your contributions. I have made some progress. Below is a simple script I gleaned from your kind responses: Sys.setenv(TZ="Etc/GMT") dates <- c("02/27/92", "02/27/92", "01/14/92", "02/28/92", "02/01/92") times <- c("23:0:0", "22:0:0", "01:00:00", "18:0:0",
2002 May 21
1
I() fails on objects of class POSIXct (PR#1587)
Although the documentation is somewhat sketchy, I() can be used to create objects of class AsIs: > I("a") [1] "a" attr(,"class") [1] "AsIs" "character" > I(4) [1] 4 attr(,"class") [1] "AsIs" "numeric" > I(4 + 0i) [1] 4+0i attr(,"class") [1] "AsIs" "complex" > This
2005 Feb 17
0
Creating a new factor from other factors and a date range
Hello useRs, I'm using version 2.0.1 on Windows XP. I have a data.frame with 3 factors and a date. The data.frame is sorted by the 3 factors and by date. I would like to create a new factor designating membership in a group. Each group is defined as having the same factor values and dates that are less than some number (e.g. 10) days apart. Does anyone have any suggestions as to how to