similar to: If Statement Help

Displaying 20 results from an estimated 60000 matches similar to: "If Statement Help"

2010 Oct 28
4
Returning highs and lows in R
I'm having trouble returning a rolling n period highest value for a data set. For each day I want to calculate the highest value over the last 3 days. I am using the following packages: zoo, xts, quantmod and TTR. Thanks, Jason GLD.Close 2010-10-01 128.91 2010-10-04 128.46 2010-10-05 130.99 2010-10-06 131.81 2010-10-07 130.37 2010-10-08 131.66 2010-10-11
2010 Oct 25
1
CRAN vs R-Forge
What's the difference between the packages you get from CRAN and R-Forge? Are the packages you get from CRAN fully developed and R-Forge work-in-progress? Regards, Jason [[alternative HTML version deleted]]
2010 Oct 29
2
Plotting 2 Lines on the Same Chart
How do I plot two time series plots on the same chart? Thanks, Jason [[alternative HTML version deleted]]
2009 May 29
2
Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified
I think I am using the improved version of setdiff(...) that handles data.frames, so I think some odd behavior was expected but this one is escaping me. It appears that the the addition of duplicate entries is not caught by the setdiff(...). Is this expected behavior? If so, is there another method or approach that should be used to identify duplicate row entries between two different data
2009 Oct 23
3
SIREN14 call setup and record/playback
I've got a fresh (1 day old) svn trunk release SVN-trunk-r225360 of Asterisk and I'm trying to get it to accept a SIREN14 call from Polycom's softphone. Having trouble with SDP negotiation, I want to only allow SIREN14 and nothing else. I also want to record and playback files, any tips on what the Record function parameters should be? In sip.conf I have: disallow=all
2012 Oct 12
1
error msg using na.approx "x and index must have the same length"
Below I have written out some simplified data from my dataset. My goal is to interpolate Price based on timestamp. Therefore the closer a Price is in time to another price, the more like that price it will be. I want the interpolations for each St and not across St (St is a factor with levels A, B, and C). Unfortunately, I get error messages from code I wrote. In the end only IDs 10 and 14 will
2007 Apr 27
1
correlation tab
hello, I know how to use the function "cor" to do correlation frame but it remains a problem because I wanna calculate correlation between vector with differents dimensions it is possible? for exemple my data : > V [[1]] [1] 97 104 103 98 99 92 99 99 98 87 95 101 91 104 98 96 84 97 92 104 97 [[2]] [1] 102 100 82 106 85 97 101 99 90 101 97 93 100 99 92 90
2004 Sep 22
5
block statistics with POSIX classes
I have a monthly price index series x, the related return series y = diff(log(x)) and a POSIXlt date-time variable dp. I would like to apply annual blocks to compute for example annual block maxima and mean of y. When studying the POSIX classes, in the first stage of the learning curve, I computed the maximum drawdown of x: > mdd <- maxdrawdown(x) > max.dd <- mdd$maxdrawdown > from
2008 Oct 08
2
Creating a matrix
Good evening. I have this following table and I would like to turn it into a matrix in which my rows would be filled with de "Sellers", my columns with my "Articles" and my data would be the mean unitary price used by each seller in each produt. Seller Art. Unit Price 1 v1 p1 9.148352 2 v2 p1 2.858073 3 v3 p1 3.775315 4 v4
2013 Nov 26
7
[PATCH RESEND 0/1] libxl: introduce an option for disabling the non-O_DIRECT
I think I posted this patch before, but it looks like it was in December 2012 (!). 1/1 libxl: introduce an option for disabling the non-O_DIRECT workaround Ideally it would go into 4.4, at least. Provided the corresponding qemu part has gone into qemu-xen, which I think it has. Can anyone confirm ?
2012 Aug 22
4
gsub -> replace substring in column
Hi all, please excuse- I'm a complete newbie to R, so it's possible my question was asked a thousand times before, but I don't get it :-( I imported a CSV file via: x=read.csv("test.csv",header=TRUE,sep="\t") In a column there are values with the dot-character (".") I want to replace with a commata: > x[9] ?????????????????? V16 1???????? GPS
2010 Oct 11
3
Dataset Transformation
I need to transpose the following input dataset into an output dataset like below Input Date TICKER Price 11/10/2010 A 0.991642 11/10/2010 B 0.475023 11/10/2010 C 0.218642 11/10/2010 D 0.365135 12/10/2010 A 0.687873 12/10/2010 B 0.47006 12/10/2010 C 0.533542 12/10/2010 D 0.812439 13/10/2010 A 0.210848 13/10/2010 B 0.699799 13/10/2010 C
2009 Dec 26
1
if else does not return right value
Hi all, I'm not getting the right results for values that are >99 using the if else function. The following illustrates the problem > x <- as.matrix(read.table("test.txt")) > x V1 V2 V3 [1,] 47 1 43 [2,] 83 2 42 [3,] 1 3 41 [4,] 39 4 40 [5,] 23 5 39 [6,] 23 6 38 [7,] 39 7 37 [8,] 32 8 36 [9,] 73 9 35 [10,] 124 10 34 Specifying the
2009 Dec 08
1
data manipulation/subsetting and relation matrix
Hi List, Here is some example data. myDat <- read.table(textConnection("group id 1 101 1 201 1 301 2 401 2 501 2 601 3 701 3 801 3 901"),header=TRUE) closeAllConnections() corr_mat <-read.table(textConnection("1 1 .5 0 0 0 0 0 0 0 2 .5 1 0 0 0 0 0 0 0 3 0 0 1.0 0 0 0 0 0 0 4 0 0 0 1 .5 .5 0 0 0 5 0 0 0 .5 1
2013 May 03
2
Find the flow data from its accumulation of the panel data
Hi, I have the panel data of income statement of several banks. The date 9803 means 1998-Q1, 9806 means 1998-Q2, etc. I transform the date code to 1 (for 1998Q1), 2 (for 1998Q2), ...., 16 (for 2011Q4) where 1, 2, .... are placed in Col1. Now the income statement of a specific quarter is actually the accumulation from the beginning of the year. For example, the cost data of 1999Q3 is the
2009 Apr 14
4
cbind
I have a list of numbers with NAs as below: > A[,1] [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [19] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [37] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [55] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [73] NA NA NA 62 78 98
2011 Jul 11
1
Ifelse statement
Hello everyone, I have a (small) issue. I already googled a lot, so I decided to use ifelse instead of if (){} else{} All the elements seem to work seperately, but combined in the ifelse statement, it doesn't seem to work. #The price function is a function which is normally distributed with only positive answers price<-function() {abs(rnorm(1,10,25))} #Before I use pieceprice in the
2011 May 04
2
[LLVMdev] identifying all dependent instructions through multi-levels of def-use relationship
While working on my optimization pass (a Function Pass), I try to replicate a call instruction and insert it at some earlier location (similar to LICM). However, the instruction I am trying to replicate has dependencies on an uncertain number of instructions that are used to generate an address. A simple example (IR segment): define void @foo() nounwind { entry: %a = alloca i32, align 4;
2012 Jan 06
1
ggplot using scale_x_date gives Error in seq.int(r1$year, to$year, by)
Dear all, ggplot gives me an error when trying to plot time series data using a date variable as the x axis. g<-structure(list(Date = c("2011-12-23", "2011-12-30", "2012-01-06", "2011-12-23", "2011-12-30", "2012-01-06", "2011-12-23", "2011-12-30", "2012-01-06"), variable = structure(c(1L, 1L, 1L, 2L, 2L,
2010 Jul 28
1
error: arguments imply differing number
mydata <- read.table(textConnection(" Id cat1 location item_values p-values sequence a111 1 3002737 100 0.01 1 a112 1 3017821 102 0.05 2 a113 2 3027730 103 0.02 3 a114 2 3036220 104 0.04 4 a115 1 3053984 105 0.03 5 a118 1 3090500 106 0.02 8 a119 1 3103304