Dear Jeff and Jim,
Thank you for sorting out this for me.
Replacing text(as.Date("2005-03-13"),5900,"b") with:
text(as.POSIXct(("2005-03-13 09:00:00"),5900,"b") resolved the problem.
Warmest regards
Ogbos
On Sun, Feb 17, 2019 at 3:05 AM Jim Lemon wrote:
>
> Hi Ogbos,
> Remember that there is an un
Hi Ogbos,
Remember that there is an underlying numeric representation of dates.
as.Date assigns dates a number of days from an agreed origin
(1970-01-01) while POSIX dates assign a number of seconds. If you plot
in one system and then try to add points in another, it's not going to
work.
Jim
On S
Jim has pointed out the strptime function, but you can use as.POSIXct function
also... so
as.POSIXct( "2005-03-13 09:00:00" )
as.POSIXct( "03/13/2005 9:00", format="%m/%d/%Y %H:%M" )
or other variations should work.
On February 16, 2019 5:41:29 PM PST, Ogbos Okike
wrote:
>Dear Jeff,
>My erro
Dear Jeff,
My error please and sorry about that.
Not "1960-05-04 09:00:00".
I meant to write as.Date("2005-03-13"),-9,"b") and "2005-03-13 09:00:00".
My problem is the additional time factor.
I can text anywhere on my plot when dealing with /mm/dd but I can't
handle the new /mm/dd/hh/mm/
Hi Ogbos,
It may be easier to use strptime:
dta<-data.frame(year=rep(2005,5),month=rep("05",5),
day=c("01","06","11","16","21"),
hour=c(2,4,6,8,10),minute=rep(0,5),second=rep(0,5),value=1:5)
dta$Ptime<-strptime(paste(paste(dta$year,dta$month,dta$day,sep="-"),
paste(dta$hour,dta$minute,dta$secon
I have no idea how text(as.Date("2005-03-13"),-9,"b") would mark your plot
anywhere near 1960-05-04 09:00:00. Perhaps someone else does. Or perhaps you
can provide an actual minimal working example of what you had working before
you changed to POSIXct.
On February 16, 2019 1:08:38 PM PST, Ogbos
Dear Jeff,
One more problem please.
When I used as.Date(ISOdate(dta$year, dta$month, dta$day,dta$hour)) to
handle date, I could use text(as.Date("2005-03-13"),-9,"b") to label
my plot.
Now that I am using as.POSIXct(ISOdatetime(year,
month,day,hour,0,0))), can you please tell me how to text "b" o
Dear Jeff,
I am alright now
Please accept my indebtedness!!!
Warmest regards
Ogbos
On Fri, Feb 15, 2019 at 8:25 AM Ogbos Okike wrote:
>
> Dear Jeff,
>
> Please hold.
> It is begging to work. There was an error somewhere. One ")" is
> missing and as I went back to check the lines one by one w
Dear Jeff,
Please hold.
It is begging to work. There was an error somewhere. One ")" is
missing and as I went back to check the lines one by one with cursor,
I stubbed on non matching bracket.
I completed, run the code again and got some result.
Will get back to you once I am through.
Thanks in
Dear Jeff,
Thank you so much.
I ran the code but got an error message. I then try to run them line by line.
The problem is in:
dta$datetime <- with( dta, as.POSIXct(ISOdatetime(year, month,day,hour,0,0)))
Error in with(dta, as.POSIXct(ISOdatetime(year, month, day, hour, 0, 0))) :
object 'dta'
The Date class is not designed to handle time... you need to use the
ISOdatetime function and convert to POSIXct instead of Date. Just be sure to
set your timezone to some appropriate value before you convert any times into
datetime types.
Sys.setenv( TZ="GMT" )
# avoid using `data` as that is
Dear List,
I have a simple code with which I convert year, month, and day to a date format.
My data looks like:
67 01 2618464
67 01 2618472
67 01 2618408
67 01 2618360
67 01 2618328
67 01 2618320
67 01 2618296
while my code is:
data <- read.table("CALG.txt", col.names
12 matches
Mail list logo