similar to: For and if confusion

Displaying 20 results from an estimated 4000 matches similar to: "For and if confusion"

2009 Jan 05
3
if statement
Hi, How do I check for two conditions in an if loop? I want to check if a value lies between 2 other values. For example, A <- ts(rnorm(120), freq=12, start=c(1992,8)) X <- 0.5 Y <- 0.8 I would like to create a new vector C for which C[i] is 0 if A[i] lies in between X and Y. Would be grateful for any help. Sorry for asking such an R-newbie question! Shruthi -- View this message
2008 Dec 18
3
Parsing unusual date format
Hello, If I have a character string like d <- c("1990m3", "1992m8") #March 1990 and Aug 1992 what is the easiest way to convert it into any standard date form; for example, d <- c("01/03/1990", "01/08/1992") I looked at as.Date but it doesn't seem to address my problem as I have an "m" stuck in the middle of my character string
2009 Feb 03
1
Using getSymbols
Hi, How can one ask getSymbols to obtain data within a specified time interval? For example, if I am downloading US PPI data: usppi <- as.zoo(getSymbols("PPIACO", src="FRED", verbose=TRUE, auto.assign=FALSE)) How do I ask getSymbols to truncate starting from Jan-1970 until present? I looked up the help file but couldn't find anything. Another newbie question, can I
2009 Jan 20
2
Confidence intervals in ccf()
Hi, I have been running the ccf() function to find cross-correlations of time series across various lags. When I give the option of plot=TRUE, I get a plot that gives me 95% confidence interval cut-offs (based on sample covariances) for my cross-correlations at each lag. This gives me a sense of whether my cross-correlations are statistically significant or not. However, I am unable to get R to
2009 Mar 10
1
HAC corrected standard errors
Hi, I have a simple linear regression for which I want to obtain HAC corrected standard errors, since I have significant serial/auto correlation in my residuals, and also potential heteroskedasticity. Would anyone be able to direct me to the function that implements this in R? It's a basic question and I'm sure I'm missing something obvious here. I looked up this post:
2009 Feb 02
1
Beveridge Nelson Decomposition
Hi, Would anyone know if it is possible to run a Beveridge Nelson decomposition of a univariate time series object in R? I searched in the help files but didn't come across any potential methods. Thanks very much, Shruthi -- View this message in context: http://www.nabble.com/Beveridge-Nelson-Decomposition-tp21789452p21789452.html Sent from the R help mailing list archive at Nabble.com.
2009 Jan 08
1
Convert to as.Date
Hi, I have an vector object that looks like DA <- c("1991q1", "1993q2") (first quarter of 1991 etc) and I want to convert it into a date object using as.Date(). I did this for montly data but am stumped when it comes to dealing with quarterly data and as.Date. Would anyone be able to help? Would be very grateful for any advice, sorry for being such an R-newbie!
2008 Dec 18
1
Indicator function for merged times (was: Re: Rr: For and if confusion)
Please start a new thread for a new topic and use a meaningful subject for sake of the archives and everyone trying to follow. Using your Int1, correcting your Int2 and using your Y (which goes to Jul not Aug as per the comment): library(zoo) > as.ts(with(merge.zoo(Int1, Int2, Y, fill = 0), pmax(Int1, Int2))) Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 1992
2010 Apr 08
2
xts off by one confusion or error
Hullo I may have missed something blindingly obvious here. I'm using xts to handle some timeseries data. I've got daily measurements for 100 years. If I try to reduce the error rate by taking means of each month, I'm getting what at first sight appears to be conflicting information. Here's a small subset to show the problem: A small set of data: > vv x
2010 Mar 18
1
probable timezone confusion with as.yearmon
It looks like a timezone issue, and it's causing confusion to me at least. My original data: gmt <- c("19880101 0000", "19880101 0100", "19880101 0300", "19880101 0400", "19880101 0500", "19880101 0600") These were converted to local dates/times with akst<-strptime(gmt,format="%Y%m%d %H%M")-(3600*9) # because I want
2009 Sep 22
3
how to convert character string with only month and year into date
Dear R helpers. I am new to plotting time data using R. wonder how to convert character time info into date in R. I searched over the web but did not find answer. the input character string is something like 03_1993 or 03-1993, so the precision is at month level. I tried the following but failed. #R code below. strptime(c("03_1993"),"%m_%Y")
2008 Nov 08
4
Plotting Standard Regression Fit-Am I wrong or a bug?
I'm trying to plot a time series (quarterly observations, seasonal effect, T=56),regression line and predicted point on the same plot. I'm using following commands: > plot(qdts,xlim=c(1982,1997)) > lines(fitted(m2)~time,data=qd,col="red") > points(predict(m2,newdata=nqd),col="blue") where: qdts<-ts(qd$durables,start=c(1982,1),freq=4)
2009 Apr 15
2
From daily series to monthly and viceversa
I have the following daily exchange rate series (from january 1st 1996 to december 31st 2008) and I want to obtain them monthly series from it. I've read about the 'zoo' library but I'm not getting it how to do it. These are the data (left column day-month-year, right column the index) 31/12/1993 1,12509 03/01/1994 1,12509 04/01/1994 1,12558 05/01/1994 1,1258 06/01/1994 1,12596
2017 Oct 06
2
Time series: xts/zoo object at annual (yearly) frequency
Hi, I'd like to make a time series at an annual frequency. > a<-xts(x=c(2,4,5), order.by=c("1991","1992","1993")) Error in xts(x = c(2, 4, 5), order.by = c("1991", "1992", "1993")) : order.by requires an appropriate time-based object > a<-xts(x=c(2,4,5), order.by=1991:1993) Error in xts(x = c(2, 4, 5), order.by =
2020 May 26
2
[ORC JIT][MLIR] GDBRegistrationListener "second attempt to perform debug registration" assert
Referring to the log messages from my previous mail… I confused myself (and probably others) by reading the “Adding MemMgr 0x55555959f440“ message as “Registering MemMgr 0x55555959f440”. Thus the address mismatch made no sense. How could we be registering a `MemMgr` address/key that does not match once we arrive in `notifyObjectLoaded` method? Answer: Because the registrations is NOT coming
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
2005 Dec 19
3
given a mid-month date, get the month-end date
I have a vector of dates. I wish to find the month end date for each. Any suggestions? e.g. For 12/15/05, I want 12/31/05, For 10/15/1995, I want 10/31/1995, etc __________________________________________________ [[alternative HTML version deleted]]
2007 Jun 13
5
Confusion with sapply
Hi, I have some confusion in applying a function over a column. Here's my function. I just need to shift non-March month-ends to March month-ends. Initially I tried seq.dates, but one cannot give a negative increment (decrement) here. return(as.Date(seq.dates(format(xdate,"%m/%d/%Y"),by="months",len=4)[4]) ) Hence this simple function: > mydate <-
2006 Nov 26
1
adding elemens to a list
Hi, I have a list of 20 elements, each of them of variable length and with a structure like this: lasker[[1]][1:10,] Var1 Freq 1 1988-02 3 2 1988-03 1 3 1988-04 1 4 1988-05 2 5 1988-06 3 6 1988-07 1 7 1988-08 1 8 1988-09 1 9 1989-03 1 10 1989-04 1 How do I can insert in this list: 1988-01 0 1988-10 0 1988-11 0 1988-12 0 1989-01 0
2004 Dec 01
1
reg win3.11 client configration
Dear sir, We are using Rethat linnex 9 with which we got samba 2.2.7a. we are able to connect windows 98 and win xp machines, but the problem is we are not able to connect win 3.11 machines is there any add-on package for connecting win 3.11 clients ( windows workgrops ) with regards Jayaram Prasad, Sr.Dy.Systems Engineer. Systems Dept. Hyderabad. jayaram