Displaying 20 results from an estimated 1000 matches similar to: "spline bug ?"
2002 May 28
2
histogramming dates
I'd like to make a plot showing frequency of an event. The data
is in a data from that includes Year, Month and Day (of month)
fields, so I created a Date with ISOdate(Year, Month, Day,
tz=''). I can plot frequencies for the year 2002 with
> thisyear <- Date[Year==2002]
> hist( thisyear, xaxt='n' )
> axis.POSIXct( 1, at=seq(min(thisyear), max(thisyear),
2004 Sep 22
5
block statistics with POSIX classes
I have a monthly price index series x, the related return series y = diff(log(x)) and a POSIXlt date-time variable dp. I would like to apply annual blocks to compute for example annual block maxima and mean of y.
When studying the POSIX classes, in the first stage of the learning curve, I computed the maximum drawdown of x:
> mdd <- maxdrawdown(x)
> max.dd <- mdd$maxdrawdown
> from
2002 Apr 29
2
Lotos 1-2-3 date to POSIXct
I have some data that was created for import into a Lotus 1-2-3 spreadsheet
and on of the columns is time. The
time is akin to Julian were the value 1 is mapped "01-Jan-00 12:00:00 AM" in
Lotus 1-2-3. Is there a function in an R package that can convert this
numeric vector to a POSIXct vector?
With best wishes and kind regards I am
Sincerely,
Corey A. Moffet
Instructor
Department
2003 Jul 26
1
bug plotting dates?
Hello R-experts!
I am using R Version 1.7.1 (2003-06-16) on a Debian Linux box and I
have discovered an odd result when plotting data involving dates. Please
try this minimal example:
a = seq(ISOdate(2000,1,1), ISOdate(2001,1,1), "months")
b = 1:13
plot(a,b, col="red")
What I get is a plot that looks as expected except the x-axis is mostly
red. Can anyone reproduce this
2008 May 23
1
Shared Library Error
Can anyone help me resolve this? A part of the R function looks like this:
print(is.loaded('merge_xtabs_patterns_file'))
print(is.loaded('merge_xtabs_patterns_file_'))
.Fortran('merge_xtabs_patterns_file_',ydim[1],ydim[2],x=as.integer(as.matrix(y)),na=as.integer(c),
maxD=as.integer(maxD),lrowmem=length(rowmem),rowmem=as.integer(rowmem),
2010 Dec 04
2
Problem storing lm() model in a list
Hi all,
I recently wrote some code to store a number of polynomial models in a list and return this list. The model is returned fine, but when I make a subsequent call to predict(), I have an error. The code for polyModel selection is listed at the end of the email. Here is an example of the error:
> poly.fit <- polyModelSelection(x,y,10,F)
> for (d in 1:4) {
+ lm.model <-
2013 Apr 24
0
Help me make faster R code for Kennard-Stone algorithm [My code is so slow from Matlab]
Hi all,
Can you help me change my Kennard-Stone algorithm to faster one?
[The original code can run fast in matlab, but when I change matlab code to
R code, it is so slow.]
Since my code so crude and too many loops (changed from matlab code), it is
too slow. I hope that you can help to improve the performance.
Thanks.
kevin
2003 Nov 19
5
ISOdate returns incorrect date?
Dear all,
I have found the following (for me) incomprehensible behaviour of
ISOdate (POSIXct):
> ISOdate(1900,6,16)
[1] "1900-06-15 14:00:00 Westeurop?ische Sommerzeit"
> ISOdate(1950,6,16)
[1] "1950-06-16 14:00:00 Westeurop?ische Sommerzeit"
Note that in the first case I get the 15th of June back, not the 16th as
I would have expected!
This happened under R-1.7.1 on
2003 Nov 14
5
ISOdate() and strptime()
Dear R-people!
I am using R 1.8.0, under Windows XP.
While using ISOdate() and strptime(), I noticed the following behaviour when
"wrong" arguments (e.g., months>12) are given to these functions:
> ISOdate(year=2003,month=2,day=20) #ok
[1] "2003-02-20 13:00:00 Westeurop?ische Normalzeit"
> ISOdate(year=2003,month=2,day=30) #wrong day, but returns a value
[1]
2007 Mar 22
2
difftime / RBloomberg
hi,
I've troubles with some difftime objects. e.g.
ISOdate(2001, 4, 26) - ISOdate(2001, 2, 26) - 2
works, telling me "Time difference of 57 days". But when I'd like to add
days, such as
ISOdate(2001, 4, 26) - ISOdate(2001, 2, 26) + 2
the function gives me an error. Function "as.COMDate.chron" of the
Rbloomberg package doesn't work for that reason.
I'm
2010 Nov 22
1
Plotting a cloud/fog of variable density in rgl
Hi everyone,
I want to plot a 3D interpolation of the concentration of aquatic
organisms. My goal would be to have the result represented as clouds
with a density proportional to the abundance of organisms, so that I
could fly (well, swim actually ;) ) through the scene and see the
patches here and there. Basically, I want to do something like this:
http://www.youtube.com/watch?v=27mo_Y-aU-c
but
2007 May 10
3
Getting the last day of the month.
Hi,
Given a date, how do I get the last date of that month? I have
data in the form YYYYMM, that I've read as a date using
> x$Date <-
as.Date(ISOdate(substr(x$YearEnd,1,4),substr(x$YearEnd,5,6),1))
But this gives the first day of the month. To get the last day of the
month, I tried
> as.Date(as.yearmon(x$Date,frac=0))
But I don't get the last day of the month here. (Tried
2002 May 21
1
I() fails on objects of class POSIXct (PR#1587)
Although the documentation is somewhat sketchy, I() can be used to create
objects of class AsIs:
> I("a")
[1] "a"
attr(,"class")
[1] "AsIs" "character"
> I(4)
[1] 4
attr(,"class")
[1] "AsIs" "numeric"
> I(4 + 0i)
[1] 4+0i
attr(,"class")
[1] "AsIs" "complex"
>
This
2006 Apr 10
3
timeAlign
I use POSIXct for datetimes. Is thee a timeAlign function that I can
use where :
align by year
direction -1 ==> start of this year
direction 1 ==> start of next year
align by week
direction -1 ==> date on last sunday
direction 1 ==> date on next sunday
align by day
direction -1 ==> time at past midnight
direction 1 ==> time at this comming
2018 Jan 22
2
Manipulating two large dataset differing by date and time
Dear Members,
Compliments of the Season!!
Below is a part of a code I use for Fourier analysis of signals. The code
handles data with the format 05 01 01 8628 (year, month, day and count)
05 01 02 8589 (year, month, day and count)
The sample data is attached as 2005daily.txt.
I would like to adapt the code to handle data of the form:
05 01 01 00 4009
2000 Sep 04
2
bug in spline()? (PR#653)
BUG IN SPLINE()?
Version R-1.0.1, system i486,linux
If the spline(x,y,method="natural") function is given values outside the
range of the data, it does not give a warning. Moreover, the extrapolated
value reported is not the ordinate of the natural spline defined by (x,y).
Example. Let x <- c(2,5,8,10) and y <- c(1.2266,-1.7606,-0.5051,1.0390).
Then interpolate/extrapolate with
2003 Sep 12
2
Sorting a vector by date
Hello out there....
Again I have a problem and I stuck...
How can I sort a vector of dates?
For example I have the vector
a<-ISOdate(2001, 1, 1) + 70*86400*runif(10)
How can this vector be sorted chronological?
And what's the function I should work with to handle these entries?
(in sense of: which(a>2001-01-04) or somehting like that)
Thank you for helping
M.Kirschbaum
2004 Nov 03
3
cut POSIX results in NA - bug?
Dear all
I try to make hourly average by cut() function, which almost works
as *I* expected. What puzled me is that if there is only one item at
the end of your data it results in NA.
Example will explain what I mean
datum<-seq(ISOdate(2004,8,31), ISOdate(2004,9,1), "min")
cut(datum[1370:1381],"hour", labels=F)
[1] 1 1 1 1 1 1 1 1 1 1 1 NA
2003 Apr 30
2
ylab in plot.POSIXct
I am using R-1.7.0 and have some data which consist of one vector of
numbers and a second corresponding vector of dates belonging to the
POSIXct class. I would like to plot the numbers against the dates.
What is the best way to do this?
It almost works to just call `plot.' However if I do this while using
the `ylab' parameter I get a warning message:
parameter "ylab"
1998 Apr 07
3
R-beta: spline problems(?)
Hi,
I am a total beginner with this whole thing so please have patience!
I am trying to run an S-plus program with a certain line:
spline(1:nrow(y), y[,1],n=100);
This crashes with:
Error: NAs in foreign function call (arg 8)
Apparently, this is caused by the last command of spline:
u <- seq(xmin, xmax, length.out = n)
.C("spline_eval", z$method, length(u), x = u, y =