Displaying 20 results from an estimated 30000 matches similar to: "Conditional Row Sum"
2006 Jul 14
2
Recreate new dataframe based on condition
Hi,
How can I achieve this in R. Dataset is as follows:
>df
x
1 2
2 4
3 1
4 3
5 3
6 2
structure(list(x = c(2, 4, 1, 3, 3, 2)), .Names = "x", row.names = c("1",
"2", "3", "4", "5", "6"), class = "data.frame")
I want to recreate a new data frame whose rows are sum of (1&2, 3&4, 5&6)
2006 May 23
5
conditional replacement
Hi
How can do this in R.
>df
48
1
35
32
80
If df < 30 then replace it with 30 and else if df > 60 replace it with 60. I have a large dataset so I cant afford to identify indexes and then replace.
Desired o/p:
48
30
35
32
60
Thanx in advance.
Sachin
2008 Mar 24
6
vlookup in R
Hi,
Is there are function similar to excel vlookup in R. Please let me know.
Thanks,
Sachin
____________________________________________________________________________________
[[alternative HTML version deleted]]
2006 Apr 21
3
Creat new column based on condition
Hi,
How can I accomplish this task in R?
V1
10
20
30
10
10
20
Create a new column V2 such that:
If V1 = 10 then V2 = 4
If V1 = 20 then V2 = 6
V1 = 30 then V2 = 10
So the O/P looks like this
V1 V2
10 4
20 6
30 10
10 4
10 4
20 6
Thanks in advance.
Sachin
2010 Jan 26
3
[LLVMdev] Crash in PBQP register allocator
Hi Sachin, llvm-dev,
I've just committed a new PBQP solver which, among other things,
should take care of this bug.
Please let me know how it works out for you.
Cheers,
Lang.
On Tue, Dec 15, 2009 at 5:54 PM, Lang Hames <lhames at gmail.com> wrote:
> Hi Sachin,
>
> Yes. Bernhard Scholz and I have just discussed a fix for this. I hope to
> commit it in the next few days. I
2008 May 13
2
Plotting Frequency Distribution in R
Hi,
How can plot a frequency distribution curve for the following data.
V1 V2
1 1 160.54%
2 1 201.59%
3 1 18.45%
4 1 179.03%
5 1 274.37%
6 1 0.00%
7 1 24.52%
8 1 39.17%
9 3 43.72%
10 1 53.06%
11 1 64.97%
12 1 79.84%
13 1 98.08%
14 1 115.32%
15 1 127.96%
16 1 155.38%
17 1 157.25%
18 1 193.17%
19 1 51.53%
20 15 99.32%
21 1 106.86%
22 1 219.44%
2010 Feb 22
9
Couldn't find Order with ID=pending_orders
I have a Controller named Orders which has a pending_orders method
which is expected to fetch some records from the database.
If i dont write a route for this method, I get the following error
when i call this method.
Couldn''t find Order with ID=pending_orders
I am using rails 2.3.5, in the previous versions i use to get this
I am not getting whether its new version requirement...
Help
2006 Apr 24
1
Handling large dataset & dataframe [Broadcast]
Here's a skeletal example. Embellish as needed:
p <- 5
n <- 300
set.seed(1)
dat <- cbind(rnorm(n), matrix(runif(n * p), n, p))
write.table(dat, file="c:/temp/big.txt", row=FALSE, col=FALSE)
xtx <- matrix(0, p + 1, p + 1)
xty <- numeric(p + 1)
f <- file("c:/temp/big.txt", open="r")
for (i in 1:3) {
x <- matrix(scan(f, nlines=100), 100,
2009 Dec 15
2
[LLVMdev] Crash in PBQP register allocator
Hi Lang,
Thanks for your inputs on the problem. I was just curious to know if you got any opportunity to work on the solution for this.
Regards
Sachin
> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
> Behalf Of Sachin.Punyani at microchip.com
> Sent: Tuesday, November 17, 2009 12:00 PM
> Subject: Re: [LLVMdev] Crash
2009 Nov 15
2
[LLVMdev] Crash in PBQP register allocator
Hi Sachin,
Confirmed: This is being caused by a subtle issue in the heuristic
PBQP solver. Specifically: R1/R2 reductions as currently implemented
can, on rare occasions, lead to the heuristic solver failing to find a
finite cost solution, even though one exists. The infinite cost
solution will always be in violation of some rule of register
allocation (failing to handle an interference, or
2006 Sep 15
2
prediction interval for new value
Hi,
1. How do I construct 95% prediction interval for new x values, for example - x = 30000?
2. How do I construct 95% confidence interval?
my dataframe is as follows :
>dt
structure(list(y = c(26100000,
60500000, 16200000, 30700000, 70100000, 57700000, 46700000, 8600000,
10000000, 61800000, 30200000, 52200000, 71900000, 55000000, 12700000
), x = c(108000, 136000,
2006 Aug 18
2
dataframe of unequal rows
Hi,
How can I read data of unequal number of observations (rows) as is (i.e. without introducing NA for columns of less observations than the maximum. Example:
A B C D
1 10 1 12
2 10 3 12
3 10 4 12
4 10
5 10
Thanks in advance.
Sachin
---------------------------------
[[alternative HTML version deleted]]
2006 Jul 06
2
KPSS test
Hi,
Am I interpreting the results properly? Are my conclusions correct?
> KPSS.test(df)
---- ----
KPSS test
---- ----
Null hypotheses: Level stationarity and stationarity around a linear trend.
Alternative hypothesis: Unit root.
----
Statistic for the null hypothesis of
level stationarity: 1.089
Critical values:
0.10 0.05 0.025 0.01
0.347 0.463
2009 Dec 15
0
[LLVMdev] Crash in PBQP register allocator
Hi Sachin,
Yes. Bernhard Scholz and I have just discussed a fix for this. I hope to
commit it in the next few days. I will let you know as soon as it goes in to
the mainline.
Regards,
Lang.
On Tue, Dec 15, 2009 at 5:34 PM, <Sachin.Punyani at microchip.com> wrote:
> Hi Lang,
>
> Thanks for your inputs on the problem. I was just curious to know if you
> got any opportunity to
2009 Nov 17
0
[LLVMdev] Crash in PBQP register allocator
Thanks Lang!
I think we can use linear scan as work around for short term.
Thanks for your help.
Regards
Sachin
> -----Original Message-----
> From: Lang Hames [mailto:lhames at gmail.com]
> Sent: Sunday, November 15, 2009 10:08 AM
> To: Sachin Punyani - I00202
> Cc: llvmdev at cs.uiuc.edu
> Subject: Re: [LLVMdev] Crash in PBQP register allocator
>
> Hi Sachin,
>
2006 Jun 26
2
write.table & csv help
Hi,
How can I produce the following output in .csv format using write.table function.
for(i in seq(1:2))
{
df <- rnorm(4, mean=0, sd=1)
write.table(df,"C:/output.csv", append = TRUE, quote = FALSE, sep = ",", row.names = FALSE, col.names = TRUE)
}
Current O/p:
x 0.287816 -0.81803 -0.15231 -0.25849 x 2.26831 0.863174
2006 Aug 18
1
Insert rows - how can I accomplish this in R
Hi,
I have following dataframe. Column A indicates months.
DF <- structure(list(A = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1,
2, 3, 4, 5, 7, 8, 11, 12, 1, 2, 3, 4, 5, 8), B = c(0, 0, 0, 8,
0, 19, 5, 19, 0, 0, 0, 11, 0, 8, 5, 11, 19, 8, 11, 10, 0, 8,
36, 10, 16, 10, 22)), .Names = c("A", "B"), class = "data.frame", row.names = c("1",
2006 May 18
1
write.csv + appending output (FILE I/O)
Hi,
How can I write the output to an excel (csv) file without printing row names (i.e without breaks). Here is my code:
library(
fn <- function()
{
q <- c(1,2,3)
write.csv(q,"C:/Temp/op.xls", append = TRUE, row.names = FALSE,quote = FALSE)
}
# Function Call
for(i in 1:3)
{
fn()
}
Present Output :
x 1 2 3 x 1 2
2006 Aug 21
1
Dataframe modification
Hi,
How can I accomplish this in R.
I have a Dataframe with 3 columns. Column B and C have same elements. But column A has more elements than B and C. I want to compare Column A with B and do the following:
If A is not in B then insert a new row in B and C and fill these new rows with
B = A and C = 0. So finally I will have balanced dataframe with equal no of rows (entries) in
2009 Nov 13
0
[LLVMdev] Crash in PBQP register allocator
This looks like a bug in the PBQP solver. I'm currently investigating.
Cheers,
Lang.
On Thu, Nov 12, 2009 at 12:46 AM, <Sachin.Punyani at microchip.com> wrote:
> Hi,
>
>
>
> Please see the two “.ll’ files attached.
>
>
>
> Command line used
>
> llc –march=pic16 –pre-RA-sched=list-burr –regalloc=pbqp new.obc
>
>
>
> The above test case