Displaying 20 results from an estimated 10000 matches similar to: "build interval"
2011 Jan 06
1
Interpolation
Hello,
I am new to R and need some help.
I have data in following format
DATA matrix
========================
DateTime o h l c
2009-01-01 07:30:00 2 3 4 5
2009-01-01 07:33:00 4 2 5 7
I am able to fill the gap using combination of seq and chron
2009-01-01 07:30:00
2009-01-01 07:31:00
2009-01-01 07:32:00
2009-01-01 07:33:00
x <-
2008 Jul 31
2
S 3 generic method consistency warning please help
I would like to include this in a package. The S3 methods on R CMD check
says
* checking S3 generic/method consistency ... WARNING
window:
function(x, ...)
window.chron:
function(data, day1, hour1, day2, hour2, ...)
See section 'Generic functions and methods' of the 'Writing R Extensions'
manual.
I have looked and can not figure it out. This function is for convience.
What
2008 Sep 22
1
as.day() Function (zoo question)
I am was going to look at the as.yearmon function in the zoo package
and write a as.day function to aggregate a time series of 96
observations per day into the mean for each day, but I don't know how
to look at the code so that I can convert it into something I can use.
On top of that I believe that it is probably an S3 method and I
haven't quite gotten that far in my programming
2008 Aug 21
1
max and min with the indexes in a zoo object (or anything else that could solve the problem)
library(zoo)
library(chron)
t1 <- chron("1/1/2006", "00:00:00")
t2 <- chron("1/31/2006", "23:45:00")
deltat <- times("00:15:00")
tt <- seq(t1, t2, by = times("00:15:00"))
d <- sample(33:700, 2976, replace=TRUE)
sin.zoo <- zoo(d,tt)
#there are ninety six reading in a day
d.max <- rollapply(sin.zoo, width=96, FUN=max)
2008 Oct 15
2
Condition warning: has length > 1 and only the first element will be used
Hello,
I've been learning R functions recently and I've come across a problem that
perhaps someone could help me with.
# I have a a chron() object of times
> hours=chron(time=c("01:00:00","18:00:00","13:00:00","10:00:00"))
# I would like to subtract 12 hours from each time element, so I created a
vector of 12 hours (actually, more like a
2012 Oct 30
0
ensembleBMA pit function warnings
Hello Chris,
I 've found two other issues
with MAE and CRPS, giving warning when running examples.
I've the same issue on my data.
Hope that you could find some time to take a
look here.
Thank you
Anna
> library(ensembleBMA)
Loading required package: chron
> example(MAE)
MAE> data(ensBMAtest)
MAE> ensMemNames <-
2012 Feb 28
0
[LLVMdev] Is it an opt bug ?
Hi Seb, I think it is an opt bug. If you run opt at -O1 then you get:
define void @t2(double* nocapture %x) nounwind {
L.entry:
%a = alloca [2 x i64], align 8
%0 = getelementptr inbounds [2 x i64]* %a, i32 0, i32 0
store i64 3, i64* %0, align 8
%1 = getelementptr [2 x i64]* %a, i32 0, i32 1
store i64 5, i64* %1, align 8
%2 = bitcast [2 x i64]* %a to double*
%3 = load double*
2011 Jan 11
1
Interpolate xts
Hello,
I have a xts object, I would like to fill the NA with linear
interpolated data. Can anyone please help.
> str(zz)
An ‘xts’ object from 2010-11-24 15:59:29 to 2010-11-24 16:00:00 containing:
Data: num [1:23401, 1] 312 312 312 312 312 ...
Indexed by objects of class: [POSIXct,POSIXt] TZ:
xts Attributes:
List of 2
$ src : chr "datafeed"
$ updated: POSIXct[1:1],
2012 Feb 28
1
[LLVMdev] Is it an opt bug ?
Hi Duncan,
Indeed, I made same experiment as you and concluded that it might be a BUG.
Shall I submit it to llvm bug tracking support ?
Do you think there could be a work-around ?
Thanks for your quick answer.
Best Regards
Seb
2012/2/28 Duncan Sands <baldrick at free.fr>
> Hi Seb, I think it is an opt bug. If you run opt at -O1 then you get:
>
> define void @t2(double*
2011 Jan 07
1
POSIXct issue
Hello I have trouble getting my original datetime back see below. I hope I
am missing something. Please help.
> tt <- as.POSIXct("2011-01-07 07:49:13", tz="EST")
> tt
[1] "2011-01-07 07:49:13 EST"
> ttn <- as.numeric(tt)
> ttn
[1] 1294404553
> tt <- as.POSIXct(ttn,origin='1970-01-01',tz="EST")
> tt
[1] "2011-01-07
2009 Jul 16
1
Calculate Timeseries Interval
Hello,
I have been attempting to write a script that automatically calculates time
intervals from a list of hh.mm.ss.ms timestamps. Should be easy, but I keep
running into problems. Any help would be greatly appreciated!!
Problems:
1. If I parse the timestamp, it doesn't always return the digits after the
decimal
2. If I subtract .5 - .955 (as in 19:22:0.5 - 19:21:59.955), then I get a
2003 Mar 06
0
loop avoiding on time interval intersects
I am trying to optimize some code to take advantage of R loop-avoiding
capabilities when working on vectors/arrays that contain time intervals.
The calculation involves adding (for each time interval) the time portion
(of events defined by their start and end times) that elapsed during time
intervals.
Any advice on how to improve this code. I searched the email archive and
looked at the MASS
2006 Oct 03
1
do.call with Vectorial Argument
Dear All,
I am trying to use the do.call command to avoid tedious loops in R
when I need to call repetitively a function.
I am experiencing a problem when the arguments of a function are given
with a vector (I need to express then this way to be able later on to
integrate them numerically with the adapt package).
Consider the small script:
remove(list=ls())
#library(adapt)
# first a list of the
2012 Jul 12
0
I: ensembleBMA pit function warnings
Hello!
I'm having some problems with
pit function in ensembleBMA. When I run on mu data I have the
same warnings as below, when I type the example(pit).
Any suggestion on how to resolve it?
> library(ensembleBMA)
Loading required package: chron
> example(pit)
pit> data(ensBMAtest)
pit> ensMemNames <-
2007 Jun 14
0
Confidence interval for coefficient of variation
This is a function I coded a few years ago to calculate a confidence
interval for a coefficient of variation. The code is based on a paper
by Mark Vangel in The American Statistician. I have not used the
function much, but it could be useful for comparing cv's from
different groups.
Kevin Wright
confint.cv <- function(x,alpha=.05, method="modmckay"){
# Calculate the
2004 Apr 10
1
confidential interval of correlation coefficient using bootstrap
I tried 2 methods to estimate C.I. of correlation coefficient of variables x and y:
> x <- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1)
> y <- c( 2.6, 3.1, 2.5, 5.0, 3.6, 4.0, 5.2, 2.8, 3.8)
#METHOD 1: Pearson's
**********************************************************
> cor.test(x, y, method = "pearson", conf.level = 0.95)
Pearson's
2024 Oct 10
1
Time zones in POSIClt objects
It is not completely clear to me how time zones work with POSIXlt
objects. For POSIXct, I can understand what happens: time is always
stored in GMT, the `tzone` attribute only affects how the times are
displayed. All computations etc. are done in GMT.
POSIXlt objects have both a `tzone` attribute and a `zone` field. It
seems that the `zone` field is largely ignored. It only seems to be used
2011 Sep 08
2
help subsetting data based on date AND time
Dear R Community,
I am new to R, and have a question that I suspect may be quite simple but is
proving a formidable roadblock for me. I have a large data set that
includes water-quality measurements collected over many 24-hour periods.
The date and time of sample collection are in a combined Date/Time field in
the format yyyy-mm-dd hh:mm:ss. I need to be able to subset the data for
analysis of
2024 Oct 11
1
Time zones in POSIClt objects
?s 15:13 de 10/10/2024, Jeff Newmiller via R-help escreveu:
> POSIXt vectors do not support different time zones element-to-element.
>
> If you want to keep track of timezones per element, you have to create a vector of timestamps (I would recommend POSIXct using UTC) and a parallel vector of timezone strings. How you manipulate these depends on your use cases, but from R's
2009 Jan 04
1
POSIXct and chron issues with tz
Dear All-
I am trying to merge two data files - they have different date formats
and different times zones. I need to match up the date/time of the
datasets and then invoke a conditional statement, such as: if dataC$mph
is >= 12 then keep dataM$co23 for the corresponding time/date stamp.
snippets of data files:
*dataC.txt*
LST in mph Deg DegF DegF2 % volts Deg