Displaying 4 results from an estimated 4 matches for "1992,8".
Did you mean:
192,8
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 in context: http://www.nabble.com/if-statement-tp21289608p21289608.ht...
2008 Dec 18
1
Indicator function for merged times (was: Re: Rr: For and if confusion)
...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 0 0 0 0 0
1993 0 0 1 1 1 1 1 1 1 1 1 1
1994 1 1 1 1 1 1 1 1 1 1 1 1
1995 1 1 1 1 1 1 1 1 1 1 1 1
1996 1 1 1 1 1 1 1 1 1 1 1 1
1997 1 1 1 1 1 1 1 1...
2008 Dec 18
1
For and if confusion
I have two date objects
X <- c("01-03-1993", "01-05-1997") #Mar 1993 and May 1997
Y <- c("01-02-1995", "01-08-1999") #Feb 1995 and Aug 1999
and a time series object
A <- ts(rnorm(120), freq=12, start=c(1992,8)) #Aug 1992 to Aug 2002
I want to create a binary (0-1) vector B that is of length 1:(A).
B should have value 1 for the time periods *across* my character vectors,
i.e. between Mar 93 ad Feb 95, and also between May-97 and Aug-99, but zero
otherwise.
Would anyone have any ideas on how to do t...
2019 Jul 23
4
[libnbd PATCH] api: Allow completion callbacks to auto-retire
...the callback to retire the command unless the callback returns C<1>.
+Other parameters behave as documented in C<nbd_trim>.
The C<callback> function is called with the same C<user_data> passed to
this function, C<cookie> set to the return value of this function,
@@ -1992,8 +1992,8 @@ returns the unique positive 64 bit cookie for this command, or
C<-1> on error. If this command returns a cookie, then C<callback>
will be called when the server is done replying,
although you must still use C<nbd_aio_command_completed> after
-the callback to retir...