Re: [R] Date format

2020-05-12 Thread Rainer Hurling
Hi Medic, Am 10.05.20 um 09:15 schrieb Medic: I took a SAMPLE CODE (for Connected scatterplot) from the R gallery and applied to MY DATA, but got: "Don't know how to automatically pick scale for object ..." P.S. 1) R ver. 4.0 (Yes, Jeff); 2) Attached: mydata_dput (1 КБ) SAMPLE CODE library(ggp

Re: [R] Date format

2020-05-10 Thread Medic
Many Thanks!!! > cpolw...@chemo.org.uk: > Your X axis is plotting mydata not date? > Use aes(x=date __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

Re: [R] Date format

2020-05-10 Thread Medic
I took a SAMPLE CODE (for Connected scatterplot) from the R gallery and applied to MY DATA, but got: "Don't know how to automatically pick scale for object ..." P.S. 1) R ver. 4.0 (Yes, Jeff); 2) Attached: mydata_dput (1 КБ) SAMPLE CODE library(ggplot2) library(dplyr) library(hrbrthemes) data <-

Re: [R] Date format

2020-05-09 Thread Rainer Hurling
Am 10.05.20 um 04:17 schrieb Bert Gunter: > $date is a factor, which is coded as numeric values internally, which > as.date sees as numeric, and therefore: > "as.Date will accept numeric data (the number of days since an epoch), > but only if origin is supplied." (from ?as.Date) as.Date is also ab

Re: [R] Date format

2020-05-09 Thread Bert Gunter
True. Whence the error message then? Still, in my attempt to reproduce, the format statement worked. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, May 9,

Re: [R] Date format

2020-05-09 Thread Jeff Newmiller
... but str says it is character. This must be 4.0... On May 9, 2020 7:17:16 PM PDT, Bert Gunter wrote: >$date is a factor, which is coded as numeric values internally, which >as.date sees as numeric, and therefore: >"as.Date will accept numeric data (the number of days since an epoch), >but only

Re: [R] Date format

2020-05-09 Thread Bert Gunter
$date is a factor, which is coded as numeric values internally, which as.date sees as numeric, and therefore: "as.Date will accept numeric data (the number of days since an epoch), but only if origin is supplied." (from ?as.Date) You need to supply a format argument to as.Date to get it to handle

[R] Date format

2020-05-09 Thread Medic
I took a SAMPLE CODE (for Connected scatterplot) from the R gallery and applied to MY DATA, but got: "Error in as.Date.numeric(mydata$date) : 'origin' must be supplied". P.S. I can not understand ?as.Date() SAMPLE CODE library(ggplot2) library(dplyr) library(hrbrthemes) data <- read.table("https:

Re: [R] date format in xyplot

2015-08-18 Thread Duncan Mackay
Duncan -Original Message- From: Christine Lee [mailto:leptostra...@yahoo.com] Sent: Wednesday, 19 August 2015 00:26 To: R; Duncan Mackay Subject: RE: [R] date format in xyplot Thank you Duncan, I have tried the scales function. It ends up with 2015-09-15, which is acceptable. It is far much

Re: [R] date format in xyplot

2015-08-18 Thread Christine Lee via R-help
- 2015年8月18日 星期二,Duncan Mackay 寫道﹕ 主題: RE: [R] date format in xyplot 收件人: "R" 日期: 2015年8月18日,星期二,下午4:08 Hi Christine If somethings go wrong: 1 first check your data str(Raw) 'data.frame':   10 obs. of  5 variables: $ Date   : F

Re: [R] date format in xyplot

2015-08-18 Thread John Kane
Sorry, quick follow-up: is there any chance you used Date rather than Date1 in the original plot? John Kane Kingston ON Canada > -Original Message- > From: r-help@r-project.org > Sent: Mon, 17 Aug 2015 21:15:39 -0700 > To: r-help@r-project.org > Subject: [R] date f

Re: [R] date format in xyplot

2015-08-18 Thread John Kane
ho knows with R :) John Kane Kingston ON Canada > -Original Message- > From: r-help@r-project.org > Sent: Mon, 17 Aug 2015 21:15:39 -0700 > To: r-help@r-project.org > Subject: [R] date format in xyplot > > To whom it may concern, > > I have tried to plot some num

Re: [R] date format in xyplot

2015-08-18 Thread Duncan Mackay
ing the parameters set by trellis.par.set() to the function to get them names(trellis.par.get() ) and going further trellis.par.get()$superpose.symbol will give you the values for superpose.symbol Beware: Do not make the labels etc so big that the axis labels are hard to read. Think of final size

[R] date format in xyplot

2015-08-17 Thread Christine Lee via R-help
To whom it may concern, I have tried to plot some numbers against time with the time on the X-axis shown as "Jan", "Feb", etc. I used the following commands: Raw<-structure(list(Date = structure(c(6L, 7L, 2L, 4L, 12L, 9L, 7L, 2L, 4L, 12L), .Label = c("1/10", "1/11", "11/11", "12/11", "13/10",

Re: [R] date format

2013-11-28 Thread arun
#Or  paste(dat[,3],dat[,2],dat[,1],sep=".") #[1] "4.1.2011" "5.2.2012" "6.3.2013" #  as.character(interaction(dat[,3:1]))  paste(sprintf("%02d",dat[,3]),sprintf("%02d",dat[,2]),dat[,1],sep=".") #[1] "04.01.2011" "05.02.2012" "06.03.2013" A.K. On Thursday, November 28, 2013 10:18 AM, Rui Bar

Re: [R] date format

2013-11-28 Thread arun
Hi, Try: dat1 <- data.frame(years=rep(1991:1992,12), months=rep(1:12,2),days= rep(1,24))  dat1$day <- format(as.Date(paste(dat1[,1],sprintf("%02d",dat1[,2]),sprintf("%02d",dat1[,3]),sep="."),"%Y.%m.%d"),"%d.%m.%Y") A.K. On Thursday, November 28, 2013 8:56 AM, eliza botto wrote: Dear Users of

Re: [R] date format

2013-11-28 Thread eliza botto
Thnx rui, Eliza > Date: Thu, 28 Nov 2013 15:16:35 + > From: ruipbarra...@sapo.pt > To: eliza_bo...@hotmail.com; r-help@r-project.org > Subject: Re: [R] date format > > Hello, > > Maybe something like the following. > > dat <- data.frame( = 2011:2013, m

Re: [R] date format

2013-11-28 Thread Rui Barradas
Hello, Maybe something like the following. dat <- data.frame( = 2011:2013, mm = 1:3, dd = 4:6) apply(dat, 1, function(x) paste(rev(x), collapse = ".")) Hope this helps, Rui Barradas Em 28-11-2013 13:54, eliza botto escreveu: Dear Users of R, I have a data frame with three column, the f

Re: [R] date format

2013-11-28 Thread eliza botto
Dear bert, arun and philipps,Thanks for your help. It worked perfectly fine for me.:D Eliza > Date: Thu, 28 Nov 2013 16:09:58 +0100 > From: wev...@web.de > To: eliza_bo...@hotmail.com; r-help@r-project.org > Subject: Re: [R] date format > > Hi Eliza, > > # you can u

Re: [R] date format

2013-11-28 Thread Ben Bolker
eliza botto hotmail.com> writes: > > Dear Users of R, > I have a data frame with three column, the first column contains years, the second one months and third one, > the days (cbind( mm dd)). I want to combine them so that i have one column with the date format as (dd.mm.). > Is there a

[R] date format

2013-11-28 Thread eliza botto
Dear Users of R, I have a data frame with three column, the first column contains years, the second one months and third one, the days (cbind( mm dd)). I want to combine them so that i have one column with the date format as (dd.mm.). Is there a way of doing that. Thanks in advance, Eliza

Re: [R] Date format conversion from "2012-09-20" to "2012:09:20"

2012-11-03 Thread veepsirtt
Hi, thanks A.K try this not working #* # Load historical data #** library('quantmod') endDate =Sys.Date() startDate = as.Date(endDate-10, order="ymd") dataspy = getSymbo

Re: [R] Date format conversion from "2012-09-20" to "2012:09:20"

2012-11-02 Thread R. Michael Weylandt
D'oh -- won't work in general (weekends!) -- serves me right for being lazy on a Friday. What your problem is that variables aren't extrapolated into strings, so you'll need to construct the subset string directly: dataspy[paste(startDate, endDate, sep="/")] or some such. (Untested!) Cheers, Mi

Re: [R] Date format conversion from "2012-09-20" to "2012:09:20"

2012-11-02 Thread R. Michael Weylandt
head(dataspy, 6) seems easiest. Cheers, Michael On Fri, Nov 2, 2012 at 6:41 PM, veepsirtt wrote: > Hi R, > How to get the range of values form startDate to lastDate as given below?. > > #* > # Load historical data > #***

Re: [R] Date format conversion from "2012-09-20" to "2012:09:20"

2012-11-02 Thread arun
#2012-10-05   146.91   147.16  145.70    146.14  124842100       146.14 #2012-10-08   145.60   146.12  145.31    145.64   78415400       145.64 A.K. - Original Message - From: veepsirtt To: r-help@r-project.org Cc: Sent: Friday, November 2, 2012 2:41 PM Subject: Re: [R] Date format co

Re: [R] Date format conversion from "2012-09-20" to "2012:09:20"

2012-11-02 Thread veepsirtt
Hi R, How to get the range of values form startDate to lastDate as given below?. #* # Load historical data #** library('quantmod') endDate =Sys.Date() startDate = as.Dat

Re: [R] Date format issue.

2011-06-28 Thread David Winsemius
On Jun 28, 2011, at 8:04 AM, Ashim Kapoor wrote: Dear R helpers, I have 2 questions : - 1. My excel sheet has a column with dates like 01/03/1980 which is formatted as 03/80 when I read this into R it reads as Mar-80. You should be able to change that from the format menu in Excel. If

Re: [R] Date format issue.

2011-06-28 Thread Ashim Kapoor
You get the NA since it is indeterminate as to the date; paste on a 1 > for the day" > Alright Jim, Many thanks. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

Re: [R] Date format issue.

2011-06-28 Thread jim holtman
You get the NA since it is indeterminate as to the date; paste on a 1 for the day" > v<-c("Mar-80") > as.Date(paste(v, '1'),format="%b-%y %d") [1] "1980-03-01" On Tue, Jun 28, 2011 at 8:04 AM, Ashim Kapoor wrote: > Dear R helpers, > > I have 2 questions : - > > 1. My excel sheet has a column wi

[R] Date format issue.

2011-06-28 Thread Ashim Kapoor
Dear R helpers, I have 2 questions : - 1. My excel sheet has a column with dates like 01/03/1980 which is formatted as 03/80 when I read this into R it reads as Mar-80. How can I read it in the source format ? 2. > v<-c("Mar-80") > as.Date(v,format="%b-%y") [1] NA > Could someone please tell m

Re: [R] Date format in plot

2009-09-02 Thread jim holtman
A reproducible example would help. What is "Phenology_VE$Date"? This works > as.Date("2009-09-01", "%Y-%m-%d") [1] "2009-09-01" Is this the date you wanted: > as.Date(39936, origin='1900-2-1') [1] "2009-06-05" On Wed, Sep 2, 2009 at 2:09 AM, swertie wrote: > > As suggested in the article R

Re: [R] Date format in plot

2009-09-02 Thread swertie
As suggested in the article R News 4/1, I used as.Date(as.character(Phenology_VE$Date), "%Y-%m-%d"), however this function returns me only "NA" values as.Date(as.character(Phenology_VE$Date), "%Y-%m-%d") [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA

Re: [R] Date format in plot

2009-09-01 Thread Gabor Grothendieck
See R News 4/1. The article on dates there discusses how they work and discusses Excel's dates as well. On Tue, Sep 1, 2009 at 1:58 PM, swertie wrote: > > Hello, I plot the abundance of a species in relation to the date. To have the > date as a continous variable I put it in the format "standard"

Re: [R] Date format in plot

2009-09-01 Thread David Winsemius
Behalf Of swertie Sent: Tuesday, September 01, 2009 12:59 PM To: r-help@r-project.org Subject: [R] Date format in plot Hello, I plot the abundance of a species in relation to the date. To have the date as a continous variable I put it in the format "standard" in excel (f.ex. 39939 means 06

Re: [R] Date format in plot

2009-09-01 Thread David Winsemius
On Sep 1, 2009, at 1:58 PM, swertie wrote: Hello, I plot the abundance of a species in relation to the date. To have the date as a continous variable I put it in the format "standard" in excel (f.ex. 39939 means 06.05.2009). R uses 39939 on the x axis, but I would like to have "06.05". I

Re: [R] Date format in plot

2009-09-01 Thread Erik Iverson
..@r-project.org] On Behalf Of swertie Sent: Tuesday, September 01, 2009 12:59 PM To: r-help@r-project.org Subject: [R] Date format in plot Hello, I plot the abundance of a species in relation to the date. To have the date as a continous variable I put it in the format "standard" in ex

[R] Date format in plot

2009-09-01 Thread swertie
Hello, I plot the abundance of a species in relation to the date. To have the date as a continous variable I put it in the format "standard" in excel (f.ex. 39939 means 06.05.2009). R uses 39939 on the x axis, but I would like to have "06.05". I tried to use as.Date as suggested in some discussion

Re: [R] date format conversion problem

2007-10-24 Thread Joao Santos
Hello Ben, First of all thanks for the reply,and sorry because I haven't replied early. In this time I find another form to create the "my time", like this: bbrass = scan("C:/Program Files/R/data PTIN/bbrass_client_2471_pool_72644_percent_in_use_500_NA.dat") regts.start = ISOdatetime(2006, 7, 1,

[R] date format conversion problem

2007-10-10 Thread Ben Bolker
Joao Santos-7 wrote: > > Hello, > > I problem is in the format of the date, my time series is like this: > > [snip] > > When I attempt to format the time like this: > > A <- read.table("file", sep="\t", col.names=c("date", "my1", "my2", > "my3")) > temp <- as.Date(A$date, format="%Y%m%d%H")