Hi Boris/ David
Many thanks for the kind assistance. I will try following your codes.
Time has always been a slippery subject to me!
Cheers
On Sat, Nov 22, 2014 at 12:59 AM, David Winsemius
wrote:
>
> On Nov 21, 2014, at 3:19 PM, David Winsemius wrote:
>
>>
>> On Nov 21, 2014, at 2:55 PM, Ragh
On Nov 21, 2014, at 3:19 PM, David Winsemius wrote:
>
> On Nov 21, 2014, at 2:55 PM, Raghuraman Ramachandran wrote:
>
>> Sorry I forgot to mention it clearly. I like to round it to the
>> nearest 30th minute that is past. So 12:28:59 will be again 12:00:00
>> and
>> 12:59:59 will be 12:30:00 et
Perhaps this ...
roundToHalf <- function(t) {
t <- as.POSIXlt(t)
if (t$min < 15) {
t$min <- 0
}
else if (t$min < 45) {
t$min <- 30
}
else {
t$min <- 0
t$hour <- t$hour + 1
On Nov 21, 2014, at 2:55 PM, Raghuraman Ramachandran wrote:
> Sorry I forgot to mention it clearly. I like to round it to the
> nearest 30th minute that is past. So 12:28:59 will be again 12:00:00
> and
> 12:59:59 will be 12:30:00 etc. Apologies for the lack of clarity in
> the beginning.
>
Tha
On Nov 21, 2014, at 2:52 PM, Raghuraman Ramachandran wrote:
> Dear guRus
>
> How can I round of time in R to the nearest 30th minute please?
>
> For example suppose if
>> Sys.time()
> [1] "2014-11-21 22:49:05.59042 GMT"
> then I would like a function that outputs 22:30:00.
>
> if Sys.time is 1
Sorry I forgot to mention it clearly. I like to round it to the
nearest 30th minute that is past. So 12:28:59 will be again 12:00:00
and
12:59:59 will be 12:30:00 etc. Apologies for the lack of clarity in
the beginning.
Many thanks
Raghu
On Fri, Nov 21, 2014 at 10:52 PM, Raghuraman Ramachandran
Dear guRus
How can I round of time in R to the nearest 30th minute please?
For example suppose if
>Sys.time()
[1] "2014-11-21 22:49:05.59042 GMT"
then I would like a function that outputs 22:30:00.
if Sys.time is 12:13:22 then I would like to get 12:00:00 etc.
Any help would be appreciated.
Ma
What timezones are you and your colleague in?
"2011-03-27 01:00:01" does not exist in some timezones, e.g.
Europe/London. As ?as.POSIXlt explains, you can expect such
non-existent inputs to give NA.
And from ?Sys.timezone:
Note that except on Windows, the operation of time zones is an
Hello list,
I was hoping I could get some help on something which is really giving
me a headache. I am using R version 2.14.1 (2011-12-22)
(Platform: x86_64-pc-mingw32/x64 (64-bit))
An object which is supposed to have times has a few elements listed as
not times but NA's
> ls()
[1] "todelet
On 2011-03-17 16:37, Axel Urbiz wrote:
Dear List,
This is an embarrassing question, but I can seem to make this work…How do I
change the font size on the xlab and on the numbers shown in the x-axis on
the time series plot below. The arguments cex.lab and cex.axis do not seem
to be 'passing' to
Hi:
Try this:
plot(ts(rnorm(100), start = 2004, freq = 12), xaxt = 'n', yaxt = 'n',
xlab = '', ylab = '')
axis(1, at = c(2004:2012), cex.axis = 0.7)
axis(2, cex.axis = 0.7)
title(xlab = 'My X lab', ylab = 'RQI', cex.lab = 0.1)
The illegible dots in the region where the axis labels would nor
Dear List,
This is an embarrassing question, but I can seem to make this work
How do I
change the font size on the xlab and on the numbers shown in the x-axis on
the time series plot below. The arguments cex.lab and cex.axis do not seem
to be 'passing' to the plot function.
plot(ts(rnorm(100), s
Hello All,
I am trying to use the unfold function in RcmdrPlugin.survival library,
which converts the survival data with time varying covariates to the
counting process notation. The problem is somehow, the event indicator
created is not correct.
Below is the data, I am trying to convert:
You can use strptime to specify the format of the date and time you want, e.g.
> x1<-strptime(x, "%Y-%m-%d %H:%M:%S")
> x1
[1] "2010-04-02 12:00:05"
> str(x1)
POSIXlt[1:1], format: "2010-04-02 12:00:05"
On Wed, Jul 21, 2010 at 8:02 AM, Aaditya Nanduri
wrote:
> Ms. Chisholm,
>
> If you could tel
Ms. Chisholm,
If you could tell us how you plan to use the variables, we will have a
better understanding of what you are looking for and will be able to help
you.
Are you looking for the time in seconds? In that case, do as Mr. Holfman
says. He just skipped the part about converting the factors t
On Jul 20, 2010, at 8:41 AM, David Winsemius wrote:
On Jul 20, 2010, at 7:33 AM, Sarah Chisholm wrote:
Hi,
I have a problem with the time formatting in R. I have entered time
in the format "MM:SS.xyz" and R has automatically classified this
as a factor, but I need it numerically. Howeve
On Jul 20, 2010, at 7:33 AM, Sarah Chisholm wrote:
Hi,
I have a problem with the time formatting in R. I have entered time
in the format "MM:SS.xyz" and R has automatically classified this as
a factor, but I need it numerically. However when I use as.numeric()
it gives me totally differe
> # depends on what you want to do with it.
> # if you just want to convert to seconds, use the following
> x <- c('12:23.45', '34:15.1', '1:34.23')
> # split by the ":"
> x.s <- strsplit(x, ":")
> # convert
> x.c <- sapply(x.s, function(a){
+ as.numeric(a[1]) * 60 + as.numeric(a[2])
+ })
>
>
>
Hi,
I have a problem with the time formatting in R. I have entered time in the
format "MM:SS.xyz" and R has automatically classified this as a factor, but I
need it numerically. However when I use as.numeric() it gives me totally
different numbers. Is there any way I can tell R to read thes inp
Dear all,
I am having difficulty to built a model of quarter sales of spirits data, and
deciding which is the best model. The yfit2, yfit3, and yfit4 lines was not
appeared right at the end. The data and script is enclosed with this email.
I am using the harmonic regression model to exam
Hi there,
I am having trouble getting the plotting of multiple time series to work.
I have used RBloomberg to download data, which I then convert to a data
frame. After I have calculated my new index values, I would like to plot the
new index.
My problem is that I can't get the plot feature to
On Sep 28, 2009, at 4:07 PM, steve_fried...@nps.gov wrote:
Hello
I'm working with a bunch of time series data. The data are
downloaded from
a server and stored as ascii files prior to reading them into R.
After reading the data sets read into R with no problem and I can us
the ts
funct
Hello
I'm working with a bunch of time series data. The data are downloaded from
a server and stored as ascii files prior to reading them into R.
After reading the data sets read into R with no problem and I can us the ts
function to coerce them to time series, sometimes this works and sometime
Copy and paste this into an R session:
Lines <- "Date,stage
4/2/1953,7.56
4/3/1953,7.56
4/4/1953,7.54
4/5/1953,7.53
4/6/1953,7.5
4/7/1953,7.47
4/8/1953,7.44
4/9/1953,7.41
4/10/1953,7.37
4/11/1953,7.33
4/12/1953,7.3
4/13/1953,7.26
4/14/1953,7.28
4/15/1953,7.28
4/16/1953,7.23
4/17/1953,7.47
4/18/195
To seperate the columns, use the "sep" argument in read.table()
mystage <- read.table("C:\\Documents and
Settings\\skfriedman\\Desktop\\R-scripts\\stage.txt", header =
TRUE,sep=',')
On Fri, Jan 30, 2009 at 4:17 PM, wrote:
>
> Hello everyone
>
>
> I'm working with R 2.8.1 on a windows machine
>
Hello everyone
I'm working with R 2.8.1 on a windows machine
I have a question regarding time series analysis
The first question is how does R expect the input file to be structured?
I'm working with a *.txt file similar to the abbreviated one here:
Date,stage
4/2/1953,7.56
4/3/1953,7.56
4/4
26 matches
Mail list logo