... forgot to post this back to the r-list.
it seems that the problem is with xts rather than zoo and yearmon per se ie
using yearmon to index xts gives inconsistent results.
grateful for any help anyone can offer.
thanks
On Sun, Apr 18, 2010 at 8:15 PM, simeon duckworth wrote:
> Hi ga
indows XP (build 2600) Service Pack 3"
> packageDescription("xts")$Version
[1] "0.7-0"
> Sys.time()
[1] "2010-04-18 19:37:26 BST"
On Sun, Apr 18, 2010 at 1:25 PM, simeon duckworth wrote:
> R-listers,
>
> I am using xts with a yearmon index, but
R-listers,
I am using xts with a yearmon index, but am getting some inconsistent
results with the date index when i drop observations (for example by using
na.omit).
The issue is illustrated in the example below. If I start with a monthly
zooreg series starting in 2009, yearmon converts this to
dear r folks
i am a bit puzzled about how to use chron as an index xts and why it differs
from zoo.
in this example, why can i index zoo but not xts
x<-1:23
time.of.day <- times(paste(x,":0:0",sep=""),format="h:m:s")
day <- dates("4/8/90")
period <- chron(dates=day,times=time.of.day)
xts(1:23,per
Dear R users
I am trying to create some new variables for a 4401 x 30 dataframe using
ddply and transform. The "id" variable i am using is a factor with 1330
levles eg
bb <- function(df) {transform(df,
years = study.year - min(study.year) + 1,
periods = length(study.year)
I'd like to be able to read multiple sheets from an excel workbook and use
the sheet name to name the resulting dataframe using RODBC. at the moment
i've figured out how to do it the long way (see below) but feel sure that
there is a speedier & possibly automatic way to do it in R. i've tried to
d mapply, but I couldn't make
> it
> > work :-( So, my best guess would be a simple loop like this:
> >
> > result <- as.character(paste(letters,colours(),"stuff",LETTERS))
> > target <- c("red","blue","green","gray&quo
get)) {
x <- target[i]
new.colour[grep((x),new.colour)] <- x
return(new.colour)
}
On Sat, Mar 28, 2009 at 9:45 AM, Stephan Kolassa wrote:
> Hi Simeon,
>
> ?gsub
>
> HTH,
> Stephan
>
> simeon duckworth schrieb:
>
>> I am trying to simplify a text v
I am trying to simplify a text variable by matching and replacing it with a
string in another vector
so for example in
colours <- paste(letters,colours(),"stuff",LETTERS)
find and replace with ("red","blue","green","gray","yellow","other") -
irrespective of case
its a large dataset, so i'd like
R-listers
I am still finding my way with R - and feel that I am making a complete dogs
dinner of something that should be pretty simple.
What I'd like to do is to create a simple function that i can use to
calculate compound growth rates (CAGRs) over a data frame. I'd like the
function to be fle
I am trying to figure out a way to download an Excel file and then read a
range into R - so that i can have a reasonably automated process. I have
been trying to use the RODBC package, but with little success. I suspect
that this isnt the right route
Here is some code. My aim is to read in the
Dear "R-listers"
I've been trying to figure out how to annotate charts in ggplot (ie add text
to line charts, highlighted boxes etc). By and large, I can get close to
what i want with base graphics, but would ideally like to use ggplot
whenever possible (additionally, i would like to add text lab
I would like to be able to shade between two lines using ggplot2 (with
faceting too). But, despite reading all the documentation on the website,
cant figure out how to do it (either because i am a novice or idiot - or,
of course, possibly both)
My data looks is readership of paid & free newspape
13 matches
Mail list logo