Re: [R] what is the faster way to search for a pattern in a few million entries data frame ?

2016-04-10 Thread Martin Morgan
On 04/10/2016 03:27 PM, Fabien Tarrade wrote: Hi Duncan, Didn't you post the same question yesterday? Perhaps nobody answered because your question is unanswerable. sorry, I got a email that my message was waiting for approval and when I look at the forum I didn't see my message and this is

Re: [R] what is the faster way to search for a pattern in a few million entries data frame ?

2016-04-10 Thread Fabien Tarrade
Hi Jim, I didn't know this one. I will have a look. Thanks Cheers Fabien Hi Fabien, I was going to send this last night, but I thought it was too simple. Runs in about one millisecond. df<-data.frame(freq=runif(1000), strings=apply(matrix(sample(LETTERS,1,TRUE),ncol=10), 1,paste,collap

Re: [R] what is the faster way to search for a pattern in a few million entries data frame ?

2016-04-10 Thread Jim Lemon
Hi Fabien, I was going to send this last night, but I thought it was too simple. Runs in about one millisecond. df<-data.frame(freq=runif(1000), strings=apply(matrix(sample(LETTERS,1,TRUE),ncol=10), 1,paste,collapse="")) match.ind<-grep("DF",df$strings) match.ind [1] 2 11 91 133 169 444

Re: [R] what is the faster way to search for a pattern in a few million entries data frame ?

2016-04-10 Thread Bert Gunter
Fabien: I was unable to make any sense of your latest response (maybe I'm just dense). If others have similar difficulties, and you fail to get a satisfactory response, I suggest that you read and follow the posting guide's request for a **small, reproducible example* (perhaps the first few dozen

Re: [R] R.squared in summary.lm with weights

2016-04-10 Thread Murray Efford
Among the 6547 matches for 'PRESS' in an sos search I find 7 packages (asbio, DAAG, qpcR, CombMSC, rknn, MPV, mixlm) with a relevant 'press' or 'PRESS' function. Of these only qpcR (PRESS), mixlm (R2pred), and rknn (rqsp) attempt to calculate PRESS R^2, as far as I can tell. None of these confr

[R] logistic regression with package 'mice'

2016-04-10 Thread Antonello Preti
Dear all, I request your help to solve a problem I've encountered in using 'mice' for multiple imputation. I want to apply a logistic regression model. I need to extract information on the fit of the model. Is there any way to calculate a likelihood ratio or the McFadden-pseudoR2 from the results o

Re: [R] what is the faster way to search for a pattern in a few million entries data frame ?

2016-04-10 Thread Fabien Tarrade
Hi Duncan, Didn't you post the same question yesterday? Perhaps nobody answered because your question is unanswerable. sorry, I got a email that my message was waiting for approval and when I look at the forum I didn't see my message and this is why I sent it again and this time I did check t

Re: [R] Adding Two-Headed Arrow in map legend

2016-04-10 Thread David Winsemius
> On Apr 10, 2016, at 1:45 PM, Miluji Sb wrote: > > Dear David, > > The device was the issue. The quartz() device works fine but pdf() does not. > Now I just need to figure out the limits for map for Europe. Thanks for all > your help and patience. After plotting a map of Europe with base

Re: [R] Adding Two-Headed Arrow in map legend

2016-04-10 Thread Miluji Sb
Dear David, The device was the issue. The quartz() device works fine but pdf() does not. Now I just need to figure out the limits for map for Europe. Thanks for all your help and patience. Sincerely, Milu On Sun, Apr 10, 2016 at 7:10 PM, David Winsemius wrote: > > > On Apr 10, 2016, at 4:12 A

Re: [R] what is the faster way to search for a pattern in a few million entries data frame ?

2016-04-10 Thread Duncan Murdoch
On 10/04/2016 2:03 PM, Fabien Tarrade wrote: Hi there, I have a data frame DF with 40 millions strings and their frequency. I am searching for strings with a given pattern and I am trying to speed up this part of my code. I try many options but so far I am not satisfied. I tried: - grepl and sub

[R] what is the faster way to search for a pattern in a few million entries data frame ?

2016-04-10 Thread Fabien Tarrade
Hi there, I have a data frame DF with 40 millions strings and their frequency. I am searching for strings with a given pattern and I am trying to speed up this part of my code. I try many options but so far I am not satisfied. I tried: - grepl and subset are equivalent in term of processing t

Re: [R] R.squared in summary.lm with weights

2016-04-10 Thread David Winsemius
> On Apr 10, 2016, at 9:38 AM, David Winsemius wrote: > >> >> On Apr 10, 2016, at 3:11 AM, Murray Efford wrote: >> >> Martin - >> Thanks, but although hatvalues() is useful for calculating PRESS, I can't >> find anything directly relevant to my question in the influence help pages. >> After

Re: [R] Adding Two-Headed Arrow in map legend

2016-04-10 Thread David Winsemius
> On Apr 10, 2016, at 4:12 AM, Miluji Sb wrote: > > Hello David, > > This is exactly what I want but I still can't get the arrows. R and R studio > is updated. Thanks again! I didn't try it in Rstudio until just now (and I don't remember that you ever mentioned RStudio as a possible issue.)

Re: [R] How to print the graphs in landscape/portrait orientation

2016-04-10 Thread David Winsemius
> On Apr 9, 2016, at 2:58 PM, jpm miao wrote: > > Hi, > > I made a few graphs by ggplot. The following codes produce a pdf file > with graphs in landscape orientation on my Windows PC, while they produce a > pdf file with the same graphs, but in portrait orientation: > > *p2 <- lapply(1:(2*n

Re: [R] R.squared in summary.lm with weights

2016-04-10 Thread David Winsemius
> On Apr 10, 2016, at 3:11 AM, Murray Efford wrote: > > Martin - > Thanks, but although hatvalues() is useful for calculating PRESS, I can't > find anything directly relevant to my question in the influence help pages. > After some burrowing in the literature I'm doubting there is an answer ou

Re: [R] unbalanced number of rows

2016-04-10 Thread John Kane
Please have a look at http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or http://adv-r.had.co.nz/Reproducibility.html It looks like you have posted in HTML and the post is close to unreadable. The data is welcome but we really should have in in dput() for

Re: [R] How to print the graphs in landscape/portrait orientation

2016-04-10 Thread John Kane
There really is nothing there to work with. Please have a look at http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or http://adv-r.had.co.nz/Reproducibility.html John Kane Kingston ON Canada > -Original Message- > From: miao...@gmail.com > Sent

Re: [R] working with unequal rows

2016-04-10 Thread Michael Dewey
Dear Saba I think the aggregate function is what you need ?aggregate should help you on the next step On 10/04/2016 12:26, Saba Sehrish via R-help wrote: Hi I have a data frame with rows specifying companies (codes are assigned to companies) and columns specify months (monthly data). The dat

[R] working with unequal rows

2016-04-10 Thread Saba Sehrish via R-help
Hi I have a data frame with rows specifying companies (codes are assigned to companies) and columns specify months (monthly data). The data is based on male (M) and female (F) information for each month. Following is an example of how my data looks like: 01 02 03 04 001 M M

Re: [R] Adding Two-Headed Arrow in map legend

2016-04-10 Thread Miluji Sb
Hello David, This is exactly what I want but I still can't get the arrows. R and R studio is updated. Thanks again! Sincerely, Milu On Sat, Apr 9, 2016 at 10:29 PM, David Winsemius wrote: > > > On Apr 9, 2016, at 1:27 PM, David Winsemius > wrote: > > > > > >> On Apr 9, 2016, at 11:18 AM, Dav

[R] unbalanced number of rows

2016-04-10 Thread Saba Sehrish via R-help
HiI have a data frame with rows specifying companies (codes are assigned to companies) and columns specify months (monthly data). The data is based on male (M) and female (F) information for each month. Following is an example of how data looks like: 01 02 03 04001 na M M M001 M M M F002 M F F

Re: [R] R.squared in summary.lm with weights

2016-04-10 Thread Murray Efford
Martin - Thanks, but although hatvalues() is useful for calculating PRESS, I can't find anything directly relevant to my question in the influence help pages. After some burrowing in the literature I'm doubting there is an answer out there (PRESS R^2 is always presented in a fairly ad hoc way).