[R] Reading specific lines from a text file in r

2014-06-05 Thread Navin Goyal
1001 0.4 0.4 0.5 -1002 0 0 0 -1003 0 0 0 table:3 conditional estimation iteration par1 par2 par3 -1000 3.1 2.2 4.2 -1001 0.5 0.5 0.5 table:4 conditional estimation iteration par1 par2 par3 -1000 2 1.2 2 -1001 0.5 0.4 0.5 -1002 0 0 0 -1003 0 0 0 ## -- Navin G

Re: [R] Error in file(file, "rt") : cannot open the connection

2012-10-12 Thread Navin Goyal
I tried changing that to simplysaspath= "C:/Program Files/SAS/SASFoundation/9.2" Still the same error :( Thanks for reply though Navin On Fri, Oct 12, 2012 at 8:24 AM, S Ellison wrote: > > > > I get this error : " Error in file(file, "rt") : cannot open > > the connection" > >... > >

[R] Error in file(file, "rt") : cannot open the connection

2012-10-11 Thread Navin Goyal
ated setwd("C:\\Documents and Settings\\\\two") data= read.csv("data.csv", header=T) head(data) info <- list( saspath="\"C:/Program Files/SAS/SASFoundation/9.2", output="C:\\Documents and Settings\\...\\two",device="tiff&q

Re: [R] Avoid loop with the integrate function

2012-04-09 Thread Navin Goyal
Hi Berend, I now understand what you were explaining. It works great. Thanks a lot for your time and help. I really appreciate it. Navin Goyal On Mon, Apr 9, 2012 at 1:26 AM, Berend Hasselman wrote: > > On 09-04-2012, at 01:26, Navin Goyal wrote: > > > Hi, > > I am

Re: [R] Avoid loop with the integrate function

2012-04-08 Thread Navin Goyal
that loops is the only way to go ? Thanks again for your help and time. Navin Goyal On Sun, Apr 8, 2012 at 4:03 AM, Berend Hasselman wrote: > > On 08-04-2012, at 08:28, Navin Goyal wrote: > > > Dear R users, > > I am running a loop with the integrate function. I have past

Re: [R] integrate function - error -integration not occurring with last few rows

2012-04-06 Thread Navin Goyal
expected Thanks again. Navin On Fri, Apr 6, 2012 at 9:56 AM, Berend Hasselman wrote: > > On 06-04-2012, at 13:14, Navin Goyal wrote: > > > Apologies for the lengthy code. > > I tried a simple (and shorter) piece of code (pasted below) and it still > gives me the same err

Re: [R] integrate function - error -integration not occurring with last few rows

2012-04-06 Thread Navin Goyal
Apologies for the lengthy code. I tried a simple (and shorter) piece of code (pasted below) and it still gives me the same error for last few rows. Is this a bug or am I doing something totally wrong? Could anyone please provide some help/pointers ? PS. beta0 was fixed to 0.001 in the previous c

Re: [R] integrate function - error -integration not occurring with last few rows

2012-04-06 Thread Navin Goyal
bshz=0.001,beta1=0.035, change=comb1$disprog[q])$value } comb1 On Fri, Apr 6, 2012 at 1:47 AM, Berend Hasselman wrote: > > On 06-04-2012, at 00:55, Navin Goyal wrote: > > > Hi, > > I am using the integrate function in some simulations in R (tried ver >

[R] integrate function - error -integration not occurring with last few rows

2012-04-05 Thread Navin Goyal
$beta22[p] ) } hz.func1<-function(t,bshz,beta1, change,other) { ifelse(t==0,bshz, bshz*exp(beta1*change+other)) } comb3<-comb2 comb3$integral=0 q<-0 for (m in i:length(comb3$ID)) { q<-q+1 comb3$integral[q]<-integrate(hz.func1, lower=0, upper=comb3$TIME[q],