Displaying 20 results from an estimated 7000 matches similar to: "select month data in ts objects"
2011 May 24
4
writing dates to a file
Hi,
I have attached the data files to this note. I use this code:
library(zoo)
z1 <- read.zoo("baltimorefludata.txt", format = "%m/%d/%Y", header = TRUE)
z2 <- read.zoo("baltimorew.txt", format = "%Y%m%d", header = TRUE)
z3<-merge(z1,z2)
write.table(z3, "fluweatherdata_baltimore2.txt", sep="\t")
R is writing the other data
2011 May 28
1
How to do operations on zoo/xts objects with Monthly and Daily periodicities
Is there an elegant way to do operations (+/-/*/ / ) on zoo/xts objects when
one serie is monthly (end of month) and the other daily (weekdays only) -
typically a monthly economic indicator and a stock index price?
Thanks,
TDB
--
View this message in context: http://r.789695.n4.nabble.com/How-to-do-operations-on-zoo-xts-objects-with-Monthly-and-Daily-periodicities-tp3558081p3558081.html
2011 Jun 22
1
question about read.columns
HI, Dear R community,
I have a large data set names dd.txt, the columns are: there are 2402
variables.
a1, b1, ..z1, a11, b11, ...z11, a111, b111, ..z111..
IF I dont know the relative position of the columns, but I know I need the
following variables:
var<-c(a1, c1,a11,b11,f111)
Can I use read.columns to read the data into R?
I have tried the following codes, but it does not work
2012 Feb 17
6
convert zoo object to "standard" R object so I can plot and output to csv file
Another newbie question
I got the 1 minute spine interpolation and 15 mean aggregation working with
many thanks to Gabor Grothendieck using Zoo functions. I got a tip from
Hasan Diwan to look at xts but it seemed I would make better progress using
code from Gabor.
Now I'm having trouble plotting this zoo object. I'm thinking I want a
function to "split" the zoo object back to
2010 Nov 23
2
Plot two zoo object with different indexes
Dear R community, I have the following two zoo objects:
MONTHLY CPI
> plot(z)
> par("usr")
[1] 1977.76333 2011.15333 70.39856 227.03744
> z=zooreg(cpius$Value,as.yearmon("1979-11"),frequency=12)
> str(z)
?zooreg? series from Nov 1979 to Oct 2010
Data: num [1:372] 76.2 77 77.8 78.5 79.5 80.3 81.1 82 82 82.6 ...
Index: Class 'yearmon' num [1:372]
2010 Sep 06
5
Time Series
Hi
How would I analyse time series with
- different lengths (i.e. one has 9 entries and the other has 14 entries)
- different frequency (i.e. dates are random - no repeated length)
- multiple values for the same time entry (e.g. 2009-10-23 below)
i.e. my data takes the form:
1st time series
2009-10-07 0.009378
2009-10-19 0.014790
2009-10-23 -0.005946
2009-10-23 0.009096
2009-11-08 0.004189
2011 Nov 04
2
Select some, but not all, variables stepwise
Hi,
I would like to fit a linear model where some but not all explanators are chosen stepwise - ie I definitely want to include some terms, but others only if they are deemed significant (by AIC or whatever other approach is available). For example if I wanted to definitely include x1 and x2, but only include z1 and z2 if they are significant, something like this:
df <-
2006 Jul 08
2
String mathematical function to R-function
hello
I make a subroutine that give-me a (mathematical)
function in string format.
I would like transform this string into function ( R
function ).
thanks for any tips.
cleber
#e.g.
fun_String = "-100*x1 + 0*x2 + 100*x3"
fun <- function(x1,x2,x3){
return(
############
evaluation( fun_String )
############
)
True String mathematical function :-( :-(
> nomes
[1]
2011 Jan 10
3
Lattice, combine histogram and line graph
Hello everyone,
I have a simple histogram of gasoline prices going back a few years that
I want to insert a line graph of consumer price index (cpi) over the
histogram. I have looked through the "Lattice" book by Deepayan Sarkar
but don't see anything there. How might this be done? An example would
be wonderful.
Current code snippet follows. For example additional field to add
2013 Mar 05
1
ggplot2: two time series with different dates in a single plot
Hi
Using the ggplot2 package, I would like to obtain a plot that contains two
time series that have data points on different dates.
For instance, one data frame looks like:
date1, value1
2010-01-05, 2921.74
2010-01-08, 2703.89
2010-01-14, 3594.21
2010-01-20, 3659.22
The other data frame looks like
date2, value2
2010-01-01, 285.85
2010-01-02, 229.20
2010-01-05, 333.91
2010-01-06, 338.27
2003 Apr 04
3
trellis.graphic in for-loop
Hi list,
I am unsuccessfully trying to produce a serious of trellis barcharts from
within a for-loop. The barcharts work outside the loop. What am I missing?
Example attached.
Thanks Herry
#XXXXXXXXXXXXXXXXXXXXXX
trellis.device(bg="white")
trellis.par.get("fontsize")->fontsize
fontsize$default<-16
trellis.par.set("fontsize",fontsize)
2020 Jun 10
2
kinit with SPN fail
Hello again, after obtaining the keytab file I tried to use kinit
keytab.file followed by the spn
$ samba-tool spn list z1
z1
User CN=z1,CN=Users,DC=home,DC=lan has the following servicePrincipalName:
zookeeper/ap42.home.lan
$ samba-tool domain exportkeytab z1.ktab --principal=z1
$ samba-tool domain exportkeytab z1.ktab
--principal=zookeeper/ap42.home.lan
$ kinit -V -k -t z1.ktab
2012 Sep 23
2
If Command in Plot
Hi Team,
I am trying to very simple plot with command plot.
Question : I am trying to plot (x,y) based on the value of Column e.
If column e value is greater than 0 then plot(x,y) otherwise do not plot it.
Data :
structure(list(x = c(1, 1, 1, 2, 2, 2, 3, 3, 3), y = c(1, 2,
3, 1, 2, 3, 1, 2, 3), e = c(0, -1, -2, 1, 0, -1, 2, 1, 0)), row.names = c(NA,
-9L), .Names = c("x",
2009 Nov 09
3
How to transform the Matrix into the way I want it ???
Hi, R users,
I'm trying to transform a matrix A into B (see below). Anyone knows how to
do it in R? Thanks.
Matrix A (zone to zone travel time)
zone z1 z2 z3 z1 0 2.9 4.3 z2 2.9 0 2.5 z3 4.3 2.5 0
B:
from to time z1 z1 0 z1 z2 2.9 z1 z3 4.3 z2 z1 2.9 z2 z2 0 z2 z3 2.5 z3 z1
4.3 z3 z2 2.5 z3 z3 0
The real matrix I have is much larger, with more than 2000 zones. But I
think it should
2009 Feb 12
2
repost: problems with lm for nested fixed-factor Anova (ANOVA I)
Dear R users,
I have posted this question several days ago and received not a single
suggestion. I believe I have provided sufficient information for at
least some help. Here I repost the question with several modifications.
I want to run nested fixed-factor Anova in R on different experiments.
I have 48 levels of the main factor x1 and 242 levels of the nested
factor z1, and continuous response
2012 Aug 08
3
help, please! matrix operations inside 3 nested loops
hello, this is my script:
#1) read in data:
daten<-read.table('K:/Analysen/STRUCTURE/input_STRUCTURE_tab_excl_5_282_559.txt',
header=TRUE, sep="\t")
daten<-as.matrix(daten)
#2) create empty matrix:
indxind<-matrix(nrow=617, ncol=617)
indxind[1:20,1:19]
#3) compare cells to each other, score:
for (s in 3:34) { #walks though the matrix colum by colum, starting at
2009 Nov 24
1
Titles in plots overlap
Hi,
I use fCopulae package to draw different graphs of univariate and bivariate skew t. But the plots titles overlap. I tried using cex.main, font.main to adjust the size but they still overlaps. Here is my code:
par(mfrow = c(3, 1))
mu = 0
Omega = 1
alpha1 = 0
alpha2 = 1.5
alpha3 = 2
alpha4 = 0.5
Z1 = matrix(dmvst(x, 1, mu, Omega, alpha1, df = Inf), length(x))
Z2 = matrix(dmvst(x, 1, mu,
2010 Nov 08
2
A more efficient way to roll values in an irregular time series dataset?
Does anyone recommend a more efficient way to "roll" values in a time series dataset?
I merged a bunch of different time series datasets (10's of thousands of them) whose observation dates and sampling interval differ. Some time series observations are reported at the beginning of the month, some at the end, some on Mondays, some on Wednesday, some annually, etc.
In the
2002 Mar 27
2
Error with nls
Dear R-group members,
I use:
platform i386-pc-mingw32
arch x86
os Win32
system x86, Win32
status
major 1
minor 4.1
year 2002
month 01
day 30
language R
I try to fit a 2 compartment model. The compartments are open, connected
to each other and
2006 Jun 15
3
matrix selection return types
Dear Rusers,
I would like some comments about the following results
(under R-2.2.0)
> m = matrix(1:6 , 2 , 3)
> m
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
> z1 = m[(m[,1]==2),]
> z1
[1] 2 4 6
> is.matrix(z1)
[1] FALSE
> z2 = m[(m[,1]==0),]
> z2
[,1] [,2] [,3]
> is.matrix(z2)
[1] TRUE
Considered together, I'm a bit surprised about