Re: [R] To plot and to extract info from a plot

2015-09-19 Thread Jim Lemon
HI Jackson, This might get you started: # plot a few squiggles plot(runif(100)+1,seq(1,0,length.out=100),xlim=c(1,6), type="l",main="Squiggles by Years", xlab="Squiggles",ylab="Years",xaxt="n") lines(runif(100)+2,seq(1,0,length.out=100)) lines(runif(100)+3,seq(1,0,length.out=100)) li

Re: [R] what is the effective method to apply the below logic for ~1.2 million records in R

2015-09-19 Thread Jim Lemon
Hi Ravi, Try this: current_customer<-0 for(row in 1:dim(A)[1]) { if(current_customer == A$Customer[row]) { if(A$Time_Diff[row] > 12) A$flag_1[row]<-1 else A$flag_1[row]<-A$flag_1[row-1]+1 } else { current_customer<-A$Customer[row] A$flag_1[row]<-1 } } Jim On Sun, Sep 20, 2015 at 12:2

Re: [R] what is the effective method to apply the below logic for ~1.2 million records in R

2015-09-19 Thread Ista Zahn
This assumes that the data are sorted by customer, and that only the first value of Time_Diff is missing for each customer (and that the first value is always missing for each customer). If those assumptions hold you can do something like A <- read.table(text = "customer Time_Diffflag_1 1

Re: [R] what is the effective method to apply the below logic for ~1.2 million records in R

2015-09-19 Thread David Winsemius
On Sep 19, 2015, at 2:09 PM, Ravi Teja wrote: > Hi, > > I am trying to apply the below logic to generate flag_1 column on a data > set consisting of ~1.2 million records in R. > > Code : > > for(i in 1: nrows) > { > if(A$customer[i]==A$customer[i+1]) >{ > >

Re: [R] Function stslshac {sphet}: heteroskedasticity and autocorrelation consistent (HAC) estimator

2015-09-19 Thread monika nov
Dear Roger, Thank you for your email. I am sorry for HTML containing email. I am not very good in IT so I didn't know that my email client is using HTML by default. Now I have tried to turn it off and I would be very grateful if you could let me know if it is all right now. Regarding my question

[R] what is the effective method to apply the below logic for ~1.2 million records in R

2015-09-19 Thread Ravi Teja
Hi, I am trying to apply the below logic to generate flag_1 column on a data set consisting of ~1.2 million records in R. Code : for(i in 1: nrows) { if(A$customer[i]==A$customer[i+1]) { if(is.na(A$Time_Diff[i])) A$flag_1[i]

Re: [R] To plot and to extract info from a plot

2015-09-19 Thread David Winsemius
On Sep 19, 2015, at 3:25 PM, Jackson Rodrigues wrote: > Hi everybody, > > I need help to plot (question 1) and to extract information from another > plot (question 2). Could anyone help me? I will be very grateful. > I do not know if I could enclose a figure here, so I saved it in my dropbox > a

Re: [R] To plot and to extract info from a plot

2015-09-19 Thread John Kane
I don't think we can do a lot with Q1 without some data. Data would probably help with Q2 as well. Have a look at the following links especially on how to use dput() to supply sample data. John Kane Kingston ON Canada > -Original Message- > From: jacksonmrodrig...@gmail.com > Sent:

[R] To plot and to extract info from a plot

2015-09-19 Thread Jackson Rodrigues
Hi everybody, I need help to plot (question 1) and to extract information from another plot (question 2). Could anyone help me? I will be very grateful. I do not know if I could enclose a figure here, so I saved it in my dropbox at https://www.dropbox.com/s/97ud54886cn6u8i/figure%20for%20r%20group

Re: [R] Plot with R un html5

2015-09-19 Thread Omar André Gonzáles Díaz
You could use Rmarkdown, and use as output: html. http://rmarkdown.rstudio.com/html_document_format.html 2015-09-19 15:46 GMT-05:00 Frank Schwidom : > Hi, > > when you can plot this graph using the rgl-package, > then you can use "rgl::writeWebGL" to create an 3D-View > in the Browser. > > Regard

Re: [R] Plot with R un html5

2015-09-19 Thread Frank Schwidom
Hi, when you can plot this graph using the rgl-package, then you can use "rgl::writeWebGL" to create an 3D-View in the Browser. Regards On Sat, Sep 19, 2015 at 04:42:47PM +0200, bgnumis bgnum wrote: > Hi al, > > I want to put a graph in a html5 webpage plotted with R (I want to get dar > from

Re: [R] Need help with GLM on R

2015-09-19 Thread Jim Lemon
Hi Georgia, In that case you are conducting an exploratory analysis, sometimes called a fishing expedition, on the effect of location. The usual procedure is to plot the populations by the areas and put the Mark I human eyeball to work. If you see some pattern that you can plausibly defend, such as

Re: [R] R2WinBUGS error

2015-09-19 Thread msjitlal
Hi Mariana, Not sure if my post was accepted. Try running R from your desktop but right clicking on the icon and selecting "Run as Administrator", rather than opening R in the normal manner. Good luck, Mark Date: Fri, 18 Sep 2015 08:43:53 -0700 From: ml-node+s789695n4712456...@n4.nabble.com To

Re: [R] R2WinBUGS error

2015-09-19 Thread msjitlal
Hi Mariana, I was not able to solve this issue entirely satisfactorily, but after speaking to IT personnel, they advised that I try running R from my desktop by right clicking on the R icon and selecting "Run as Administrator", rather than opening in the normal manner. Remarkably this avoided the

[R] Plot with R un html5

2015-09-19 Thread bgnumis bgnum
Hi al, I want to put a graph in a html5 webpage plotted with R (I want to get dar from Google finance). Is it posible? F.e NYSE:C Does everybody know how to plot (with code) un html5 to plot trough R o directly plot the sale plot with monthly data? I Hope you can help me explosing an example.

Re: [R] How to replace strings in data frames by condition

2015-09-19 Thread sakko
Hi Jim, I just tried the code and it worked perfectly! You brought me a huge step nearer to my bachelors degree ;) thank you very much! Robert -- View this message in context: http://r.789695.n4.nabble.com/How-to-replace-strings-in-data-frames-by-condition-tp4712469p4712491.html Sent from the

Re: [R] Estimating Endogenous Selection Model

2015-09-19 Thread Johannes Muck
Dear Arne, thank you very much! Best, Johannes -Ursprüngliche Nachricht- Von: Arne Henningsen [mailto:arne.henning...@gmail.com] Gesendet: Samstag, 19. September 2015 07:07 An: Johannes Muck Cc: r-help@r-project.org Betreff: Re: [R] Estimating Endogenous Selection Model Dear Johannes

Re: [R] Function stslshac {sphet}: heteroskedasticity and autocorrelation consistent (HAC) estimator

2015-09-19 Thread Roger Bivand
monika nov gmail.com> writes: > > Dear R-users, > > I have quite basic question for econometricians, however I would like to be > sure in this. > > If I use a HAC estimator of the variance-covariance (VC) matrix for a > spatial econometric model, do I still need to test the residuals for > spa

Re: [R] R code help!

2015-09-19 Thread Adams, Jean
Here's one way to save your results, using a list of lists and a for() loop. nsim <- 100 outputs <- vector("list", nsim) for(i in 1:nsim) { outputs[[i]] <- sim.f(p.s=.05, N=1000, sample.size=69, n.sim=500) } Jean On Fri, Sep 18, 2015 at 2:27 PM, SH wrote: > Dear R users, > > I am trying to s

Re: [R] How to coerce a parameter in nls?

2015-09-19 Thread ProfJCNash
Besides this, using bounds to fix (also called "mask") parameters is generally a very bad idea. Some optimization methods allow this explicitly. For nonlinear least squares nlmrt package has it, but I'm not sure I fully documented the process. For optimization, Rvmmin and Rcgmin both allow mask

Re: [R] How to coerce a parameter in nls?

2015-09-19 Thread Sarah Goslee
You need to read the help more closely. start should be a list, as you've done, but upper and lower should be vectors instead. Which is exactly what your error message is telling you. lower, upper vectors of lower and upper bounds, replicated to be as long as start. If unspecified, all parameters