similar to: zoo. window

Displaying 20 results from an estimated 4000 matches similar to: "zoo. window"

2006 Feb 20
3
Boxplot Help for Neophyte
R helpers I am getting to grips with R but came across a small problem today that I could not fix by myself. I have 3 text files, each with a single column of data. I read them in using: myData1<-scan("C:/Program Files/R/myData1.txt") myData2<-scan("C:/Program Files/R/myData2.txt") myData3<-scan("C:/Program Files/R/myData3.txt") I wanted to produce a
2011 Feb 10
1
about prediction with a factor
Hi, I don't know how to make prediction with a factor in the linear model. Say yd=c(1,2,3,4,5) > sl=c(2,3,4,5,6) > sex=c("male","male","female","female","male") > sex=factor(sex) > m=lm(sl~yd+sex+sex:yd) How to make a prediction with new data like yd=c(4,5,6,7,8) for male and female separately ? Thank you very
2011 Feb 25
1
speed up process
Dear users, I have a double for loop that does exactly what I want, but is quite slow. It is not so much with this simplified example, but IRL it is slow. Can anyone help me improve it? The data and code for foo_reg() are available at the end of the email; I preferred going directly into the problematic part. Here is the code (I tried to simplify it but I cannot do it too much or else it
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
Hello dear members of R-help and R-core mailing list, I am not sure if this request is a "ticket" that should be filled somewhere outside the mailing list. If so, I apologize for not doing and would like to know where I should have filled it. And to the subject matter: I would like to use a command like this: plot(c(1,8), 1:2, type="n") polygon(1:7, c(2,1,2,NA,2,1,2),
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
Hello dear members of R-help and R-core mailing list, I am not sure if this request is a "ticket" that should be filled somewhere outside the mailing list. If so, I apologize for not doing and would like to know where I should have filled it. And to the subject matter: I would like to use a command like this: plot(c(1,8), 1:2, type="n") polygon(1:7, c(2,1,2,NA,2,1,2),
2009 Oct 28
1
New variables "remember" how they were created?
Hello all, I hope this question is appropriate for this ML. Basically, I am wondering if when you create a new variable, if the variable holds some information about how it was created. Let me explain, I have the following code to replicate an example in a textbook (Greene's Econometric Analysis), using the systemfit package. dta <-
2011 Jun 08
1
Autocorrelation in R
Hi, I am trying to learn time series, and I am attending a colleague's course on Econometrics. However, he uses e-views, and I use R. I am trying to reproduce his examples in R, but I am having problems specifying a AR(1) model. Would anyone help me with my code? Thanks in advance! Reproducible code follows: download.file("https://sites.google.com/a/proxima.adm.br/main/ex_32.csv
2012 Apr 29
1
CForest Error Logical Subscript Too Long
Hi, This is my code (my data is attached): library(languageR) library(rms) library(party) OLDDATA <- read.csv("/Users/Abigail/Documents/OldData250412.csv") OLDDATA$YD <- factor(OLDDATA$YD, label=c("Yes", "No"))? OLDDATA$ND <- factor(OLDDATA$ND, label=c("Yes", "No"))? attach(OLDDATA) defaults <- cbind(YD, ND) set.seed(47) data.controls
2010 Apr 20
1
converting a zoo or an xts to a data frame
Dear R People: I have the following code that I use to convert a monthly zoo object to a data.frame, and it works perfectly: library(tseries) z <- get.hist.quote(instrument=inst1, start=start1,end=end1, quote=quot1,comp = "m") y <- as.ts(aggregate(z, as.yearmon, tail, 1)) y.df <- data.frame(y=y,time=time(y)) y.df$x <- ts(y.df[,1]) tsp(y.df$x) <-
2008 Aug 31
1
Parenthesis recognition with grep
Dear R-users, I need to dynamically recognize the index of a given string myStr in a vector of string. The problem is that myStr might contain parenthesis, causing grep not to recognize it the way I want (see below). The help mentions that the pattern used by grep should be in the POSIX format... I guess the problem is here; unfortunately, I am not familiar with the subtleties of the POSIX
2009 Jan 23
1
extract certain months toyears (zoo)
Dear useRs and developeRs, In my diploma thesis I work with a daily time series of glacier runoff data. I did already aggregate them to monthly means etc. Now i want to use just the summer values (I am indecisive by now what that means, but let's make it easy and use months like June). Is there a way to extract the data off this zoo into another zoo with frequency=1 ? Do you have
1997 Sep 05
2
R-beta: help with R simulation
[[this bounced first, because it has 'help' in the Subject line ... -- Martin Maechler ]] I am a complete novice R programmer. (Though I know C quite well) I am trying to write some R code to do the following simulation. There is a 2-frame "movie" of noise and signal dots. the noise dots have random positions in each frame. The signal dots are placed randomly in frame 1,
2010 Apr 18
4
confused with yearmon, xts and maybe zoo
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 "Dec-2008". Not such a worry for my example, but strange. Having converted to xts, i drop
2017 Sep 18
3
Convert data into zoo object using Performance analytics package
Dear All, While i am trying convert data frame object to zoo object I am getting numeric(0) error in performance analytics package. The source code i am using from this website to learn r in finance: https://faculty.washington.edu/ezivot/econ424/returnCalculations.r # create zoo objects from data.frame objects dates.sbux = as.yearmon(sbux.df$Date, format="%m/%d/%Y") dates.msft =
2013 Feb 12
3
Changing the order of months within a year
I have data that looks like below and I would like to re-order the values within the "date" column. I would like to have each year organized like so: Sep-71 Oct-71 Nov-71 Dec-71 Jan-71 Feb-71 Mar-71 Apr-71 May-71 Jun-71 Jul-71 Aug-71 Sep-72 Oct-72 etc... Is there any way I can order the column in my own fashion and just move Sep-Dec to the beginning of each year? I am planning on doing
2009 Nov 09
1
zoo: bug with unique for yearmon
I'm using R 2.10.0, with zoo 1.5-8. The release notes for zoo 1.5-8 claim a bug with unique for yearmon objects has been fixed, but I'm still having problems. Browse[1]> tmp2 [1] "Dec 1996" "Dec 1996" Browse[1]> unique(tmp2) [1] "Dec 1996" "Dec 1996" Browse[1]> unique(unique(tmp2)) [1] "Dec 1996" Browse[1]> as.numeric(tmp2) -
2012 May 04
1
zoo package; a question on as.yearmon and as.yearqtr
Hello, In zoo package, if I would like the time frame to be 1981M01 to 1982M12, then I code time_0<-as.yearmon("1981-01")+(0:23)/12 However, if the time frame of interest becomes 1981M01 to 2011M12, it is relatively hard to calculate the number of months. Is there any faster way to do it? Thanks, miao [[alternative HTML version deleted]]
2011 Feb 24
1
Selecting data based on the range of dates
Hi: I want to give an index with all the dates between Sept. to Nov. as 1, and anything else is 0. It doesn't matter which year it is, as long as it is between Sept. to Nov, then set up to 1, otherwise is 0. My data frame looks like below: ID Date 201 1/1/05 6:07 AM 201 3/27/09 9:45 AM 201 9/29/09 8:44 AM 203 10/16/08 10:01 AM 203 10/28/08 9:45 AM 203 10/31/08 11:12 AM 203 11/7/08 11:32 AM
2009 Dec 22
1
Using zoo() to aggregate daily data to monthly means
I am trying to get monthly means for a daily data series using zoo(). I have found an odd problem, that seems to be caused by zoo()'s handling of leap years. Here's my R script with 2 methods (freq=365, 366) for aggregating the daily data to monthly series: library(zoo) J_link <- "http://www.ijis.iarc.uaf.edu/seaice/extent/plot.csv" JAXA_data <- read.table(J_link,
2008 Mar 03
1
Formating a zoo dataset .
Suppose I have following dataset : > head(data1) Date Return 1 03/31/00 0.14230650 2 04/28/00 -0.03276228 3 05/31/00 -0.06527890 4 06/30/00 -0.04999873 5 07/31/00 -0.01447902 6 08/31/00 0.22265729 Now I convert it to zoo object : > data11 = zoo(data1[,2], as.Date(data1[,1], format="%m/%d/%y")) > head(data11) 2000-03-31 2000-04-28 2000-05-31