Enrico seems to have found the problem - you can't change dates much
by changing the time zone, but transposing month and day will do the
trick nicely. The mm/dd/ format and others like it are so common
that you always have to be on the lookout for it. Is the sample data
you included in your fi
> On Wed, 8 Jan 2020 17:43:29 +0100, Ogbos Okike
> writes:
Ogbos> Dear Enrico,
Ogbos> Thanks for your time.
Ogbos> I have tried to learn how to use dput in R. I have not yet made much
progress.
Ogbos> I have succeeded in using dput to store my data frame. I first
Ogbos> conve
a) R cannot deal with POSIXt vectors having more than one timezone in one
vector. Won't happen. You need to separate the data into different data frames
if you need to deal with importing data with different timezones.
b) You say you included the lines
Sys.timezone()
str(OlsonNames())
in your
Dear Jeff,
Thank you very much for looking into this.
I have made some search on ?OlsonNames.
System time zones indicates Africa/Lagos whereas the data I am trying
to convert are Cosmic ray data prepared at different time zones
including Oulu station (Russia), Climax station (America), many parts
Dear Enrico,
Thanks for your time.
I have tried to learn how to use dput in R. I have not yet made much progress.
I have succeeded in using dput to store my data frame. I first
converted my data into a data frame and then used:
dput(dd,file="Ogbos2",control = c("keepNA", "keepInteger",
"showAttrib
In your first email you said you were using
Sys.setenv( TZ="GMT" )
in your code, which defines the default assumption for time conversion timezone
(at least until you change it). Keep in mind that you may be dealing with data
from other timezones than your local one that the operating system us
Dear Jim,
In order to check whether I have a correct time on my system, I run:
$ timedatectl
and it gives:
Local time: Wed 2020-01-08 13:03:44 WAT
Universal time: Wed 2020-01-08 12:03:44 UTC
RTC time: Wed 2020-01-08 12:03:44
Time zo
Quoting Ogbos Okike :
Dear Friends,
A sample of my data is:
98 05 01 028541
98 05 01 038548
98 05 01 048512
98 05 01 058541
98 05 01 068509
98 05 01 078472
98 05 01 088454
98 05 01 098461
98 05 01 108462
98 05 01 118475
98 05 01 128433
98 05 01 13
Dear Jim,
Thank you for coming my assist me.
I have tried all you suggested but the same result keep coming.
I tried, for example:
dta <- read.table("Ohr1may98", col.names = c("year", "month", "day",
"hour", "counts"))
dta$year <- with( dta, ifelse(year < 50, year + 2000, year + 1900))
dta$date<-s
Hi again,
Small typo, should be
dta$date<-strptime(paste(dta$year,dta$month,dta$day,dta$hour),
"%Y %m %d %H"
as I tried it both with and without the century just to check and
copied the wrong line.
On Wed, Jan 8, 2020 at 9:03 PM Jim Lemon wrote:
>
> Hi Ogbos,
> I get the correct result using s
Hi Ogbos,
I get the correct result using strptime:
dta$date<-strptime(paste(dta$year,dta$month,dta$day,dta$hour),
"%y %m %d %H"
)
> dta$date
[1] "1998-05-01 02:00:00 AEST" "1998-05-01 03:00:00 AEST"
[3] "1998-05-01 04:00:00 AEST" "1998-05-01 05:00:00 AEST"
[5] "1998-05-01 06:00:00 AEST" "1998-05-
11 matches
Mail list logo