Displaying 20 results from an estimated 4000 matches similar to: "Issue with aggregate.ts and/or %\% on Windows"
2010 Apr 20
1
bug in aggregate.ts
Hi,
I am getting unexpected behaviour from aggregate.ts(). The 'ndeltat'
argument is effectively being reduced by 1 in some cases, even when it
is an integer, with the result that the blocks to be aggregated are
not of the expected size, and also that the end() of the aggregated
series is much later than the end() of the original series.
rawts <- ts(rep(1:10, each = 5), start = 1)
##
2005 May 16
1
Omitting NAs in aggregate.ts()
I have a time series vector (not necessarily ts class) that has NAs in
it.
How can I omit the NAs when using aggregate.ts() to compute a function
on each window? If there is at least one non-NA value in each window,
I'd like to proceed with evaluating the function; otherwise, I would
like NA returned. I'm not wedded to aggregate.ts and don't need ts
class if there is another fast,
2009 Apr 24
1
Managing DLLs with the same names in an R session
I am having a problem using two DLLs with the same name, but obviously
located in different directories, in an R session. The troublesome
package is the (Bioconductor) Rgraphviz package. It relies on (3rd party
software) graphviz and imports functions from (Bioconductor) package
graph. Unfortunately, the current stable release of graphviz for Windows
2008 Jan 08
0
Using aggregate() and apply() on circular data
I would like to use aggregate.ts() and apply() on circular data, but I
can't figure out how to get the circular data components to pass
through:
library(circular)
x <- circular(c(20, 30, 355, 5, 345, 25), units = "degrees")
% I want to get the mean angle for each successive pair; answer should
be c(25, 0, 5):
aggregate.ts(x, ndeltat=2, FUN="mean.circular")
Error in
2000 Apr 11
0
start.ts, end.ts (PR#513)
I'm having trouble with column-subsetting a multivariate time
series. The underlying problem is with start().
R> x <- ts(matrix(rnorm(100), ncol=2))
R> y <- aggregate(x, ndeltat=2)
R> y[,1]
Error in ts(y, start = start(x), freq = frequency(x)) :
invalid start
R> start(y)
[1] 2 1
R> frequency(y)
[1] 0.5
The point where the error occurs in ts() is:
2009 Aug 18
1
aggregating values at discreet irregular time intervals into hourly values
Hello R users,
I'm a newby to R (and programming software at large) and I would need some help to sum up event data at discreet time and irregular time interval into a hourly frequency.
Here is an example of my time series frame (irregular time-serie object - irts in the tseries package):
time value
2008-12-19 19:11:03 GMT 1
2008-12-19 19:12:00 GMT 0
2008-12-19
2012 Sep 03
1
Typo (?) in 'aggregate.formula'
In the code for 'aggregate.formula', there is
if (as.character(formula[[2L]] == "."))
I believe that it is meant to be
if (as.character(formula[[2L]]) == ".")
However,
if (as.character(formula[[2L]] == "."))
gives the expected result.
Tracing:
- formula[[2L]] == "."
is equivalent to
as.character(formula[[2L]]) == "."
From the help page for
2006 May 31
1
Inconsistent behaviour when manipulating a ts object with frequency = 12 or 4
Dear All,
I found the following under R 2.3.0 on WINXP (tested on 2 PCs, I do
not have access to Linux from this PC, sorry ... )
> set.seed(10)
> x <- ts(rnorm(6),frequency=7)
> x
Time Series:
Start = c(1, 1)
End = c(1, 6)
Frequency = 7
[1] 0.01874617 -0.18425254 -1.37133055 -0.59916772 0.29454513 0.38979430
> x[24] <- NA
> x
Time Series:
Start = c(1, 1)
End = c(1, 6)
2009 Jun 22
2
question about using _apply and/or aggregate functions
Hi R-list,
I'll apologize in advance for (1) the wordiness of my note (not sure
how to avoid it) and (2) any deficiencies on my part that lead to my
difficulties.
I have an application with several stages that is meant to simulate
and explore different scenarios with respect to product sales (in
units sold per month). My session info is at the bottom of this note.
The steps include (1) an
2011 Nov 29
2
aggregate syntax for grouped column means
I am calculating the mean of each column grouped by the variable 'id'.
I do this using aggregate, data.table, and plyr. My aggregate results
do not match the other two, and I am trying to figure out what is
incorrect with my syntax. Any suggestions? Thanks.
Here is the data.
myData <- structure(list(var1 = c(31.59, 32.21, 31.78, 31.34, 31.61, 31.61,
30.59, 30.84, 30.98, 30.79, 30.79,
2009 Oct 21
2
How to average subgroups in a dataframe? (not sure how to apply aggregate(..))
Dear all,
Lets say I have the following data frame:
> set.seed(1)
> col1 <- c(rep('happy',9), rep('sad', 9))
> col2 <- rep(c(rep('alpha', 3), rep('beta', 3), rep('gamma', 3)),2)
> dates <- as.Date(rep(c('2009-10-13', '2009-10-14', '2009-10-15'),6))
> score=rnorm(18, 10, 3)
> df1<-data.frame(col1=col1,
2008 Mar 06
1
can't merge zoo ojects and convert to ts (been trying for 2 days)
I'm stuck, but am sure it can be done I just don't understand how.
I have data in an irregular timeseries. I want to be able to use stl to
visualise the data (see seasonal parts etc), so I need to change to regular
series of class ts (I think).
I am using 2 zoo objects one is regular and the other is my irregular data.
I am then merging to create the object I want but when I try to change
2011 Feb 04
4
aggregate function - na.action
Can someone please tell me what is up with na.action in aggregate?
My (somewhat) reproducible example:
(I say somewhat because some lines wouldn't run in a separate session, more
below)
set.seed(100)
dat=data.frame(
x1=sample(c(NA,'m','f'), 100, replace=TRUE),
x2=sample(c(NA, 1:10), 100, replace=TRUE),
x3=sample(c(NA,letters[1:5]), 100, replace=TRUE),
2009 May 10
2
In C, a fast way to slice a vector?
Hello,
Suppose in the following code,
PROTECT(sr = R_tryEval( .... ))
sr is a RAWSXP vector. I wish to return another RAWSXP starting at
position 13 onwards (base=0).
I could create another RAWSXP of the correct length and then memcpy
the required bytes and length to this new one.
However is there a more efficient method?
Regards
Saptarshi Guha
2010 May 24
2
AM/PM strptime %p failing 2.11.0 WinXP
I am attempting to import dates in the following format to R:
5/20/2010 6:45:32 PM
Unfortunately I am unable to get the AM/PM function (%p) to work correctly
under either 2.11.0 or 2.8.1.
> strptime("5/20/2010 6:45:32 PM", "%m/%d/%Y %I:%M:%S %p")
[1] NA
but
> strptime("5/20/2010 6:45:32", "%m/%d/%Y %I:%M:%S")
[1] "2010-05-20 06:45:32"
2012 Feb 16
1
Unstable reproduce for potential issue with CHARSXP creation
I stumbled across one of those intermittent bugs where the code
sometimes works and sometimes doesn't. Below is an example run showing
a failure where a CHARSXP object was not properly created (by the sub
function?). I was able to reproduce this error on three different R
builds in fresh R sessions, but it sometimes takes a few start up R ->
run code -> close R iterations for the
2008 Apr 09
1
Windows problem related to using shortPathName for Sweave style file
In the process of updating R to R 2.7 alpha or R 2.7 beta for the
BioConductor 2.2 builds on Windows, I have hit a snag because the BioC
build system has long path names (e.g. D:\biocbld\bbs-2.2-bioc\R) and
these path names are not resolving properly by MiKTeX 2.7 during
vignette construction. Take, for example, the attached vignette from
Biobase, Bioconductor.Rnw. I have built R from source
2010 Feb 12
2
Unexpected behaviour of x[i] when i is a matrix, on Windows
Hi,
when running the following on different instances of R (Linux and
Windows), I get different results. The one for Linux seems to be the
intended / documented one. When using numeric indices rather than
characters, Windows seemed to behave as expected.
-----------On Windows--------------
x = matrix(FALSE, nrow=3, ncol=3)
colnames(x) = LETTERS[1:3]
rownames(x) = letters[1:3]
x
# A
2010 Apr 23
1
doBy and Hmisc on R version 2.11.0
I installed R 2.11.0, and I don't think I can load the doBy package
now. Any suggestions?
> library("doBy")
Loading required package: survival
Loading required package: splines
Error in loadNamespace(i[[1L]], c(lib.loc, .libPaths())) :
there is no package called 'Hmisc'
Error: package/namespace load failed for 'doBy'
> sessionInfo()
R version 2.11.0
2010 Jan 02
3
Help needed on applying a function across different data sets and aggregating the results into a single data set
Hi folks,
Wish y'all a Happy New Year 2010!
I need some help with the following:
Say I have lots of data sets, on which I have to apply a certain function on
the same set of columns in each of the data set. Let's take, for ex, the
typical data set is:
df1 <- as.data.frame(cbind(rnorm(10),rnorm(10)))
names(df1)[1] <- "A"
names(df1)[2] <- "B"
There are many