[R] info markers from plotgoogMaps

2015-02-18 Thread Janue Miret, Jofre
Solution: http://stackoverflow.com/questions/28447247/change-in-google-maps-api-v3-on-feb-10-2015-breaks-existing-maps-created-using https://maps.google.com/maps/api/js?sensor=falsev=3.18 De: Janue Miret, Jofre Enviat el: diumenge, 15 / febrer / 2015

Re: [R] %%

2015-02-18 Thread Duncan Murdoch
On 17/02/2015 11:03 PM, Hadley Wickham wrote: On Tue, Feb 17, 2015 at 6:02 PM, Hervé Pagès hpa...@fredhutch.org wrote: On 02/17/2015 02:10 PM, Erich Neuwirth wrote: AFAIK dplyr imports magrtittr. So dplyr ses %% from migrittr, it does not have its own version. But it has its own man page so

[R] expressions from dataframe columns

2015-02-18 Thread Alexander.Herr
Hi List, I am trying to assign a large expression. It has about 140 lines of code, so of course this is cumbersome: list('10001'=list(panel=c(PanelOne=944), seltype='Equal'), '10002'=list(panel=c(PanelOne=454), seltype='Equal'), '10003'=list(panel=c(PanelOne=1210), seltype='Equal'),

Re: [R] Numerical stability of eigenvalue and hessian matrix in R

2015-02-18 Thread C W
Hi Ben and JS, Thanks for the reply. I tried using: hessian(func = h_x, x, method = complex), it gives zero, that's good. # R code hess.h - hessian(func = h_x, x, method = complex) mat - h_x(x)*hess.h - grad(h_x, x) %o% grad(h_x, x) mat [,1][,2] [,3][,4] [1,] 2060602

Re: [R] How do I know which package is loaded?

2015-02-18 Thread Thierry Onkelinx
Dear Aron, - Set the build tools in RStudio to build a package (via Tools - Project options - Build tools) - Use the Build pane to Build and then Check the package Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team

Re: [R] Numerical stability of eigenvalue and hessian matrix in R

2015-02-18 Thread Thierry Onkelinx
Have a look at FAQ 7.31 ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician after the experiment is done may

[R] Request for Help with Specifying Priors for MCMC Logit

2015-02-18 Thread Dinesh Mathur S
Hello, I am working on a research project at the University of Maryland and as part of this project I am trying to perform a bayesian analysis. I am facing difficulty specifying priors using the MCMClogit package. My question is how do we specify a column vector as a prior mean and a square

[R] time conversions

2015-02-18 Thread Troels Ring
dear friends - sorry to ask another simple question - I have dates set up as this: dates #[1] 2003-01-21 01:08:00 To handle it I did as.POSIXlt(dates) 2003-01-21 01:08:00 CET but noticed that during write.table it was apparently better to take it further

Re: [R] How do I know which package is loaded?

2015-02-18 Thread Aron Lindberg
Thanks! That’s perfect. Key is to load the local github repo into an Rstudio project first. --  Aron Lindberg Doctoral Candidate, Information Systems Weatherhead School of Management  Case Western Reserve University aronlindberg.github.io On Wed, Feb 18, 2015 at 11:39 AM, Thierry

Re: [R] time conversions

2015-02-18 Thread peter dalgaard
On 18 Feb 2015, at 18:45 , Troels Ring tr...@gvdnet.dk wrote: dear friends - sorry to ask another simple question - I have dates set up as this: dates #[1] 2003-01-21 01:08:00 To handle it I did as.POSIXlt(dates) 2003-01-21 01:08:00 CET but noticed that during write.table it was

Re: [R] time conversions

2015-02-18 Thread Rui Barradas
Hello, Try as.POSIXlt(1043107680, origin = 1970-01-01, tz = CET) Hope this helps, Rui Barradas Em 18-02-2015 17:45, Troels Ring escreveu: dear friends - sorry to ask another simple question - I have dates set up as this: dates #[1] 2003-01-21 01:08:00 To handle it I did as.POSIXlt(dates)

Re: [R] grepping out columns

2015-02-18 Thread Federico Lasa
David's almost works except it catches the MONTH column, just add an empty metacharacter tho. c(DAY, MONTH, YEAR, SA_TUES, SA_MON, SU_WED, CH_TUES, CH_WED, CH_MON, AR_TUES, AR_WED, AR_MON, SA_THUR, SU_FRI, CH_THUR, CH_FRI, AR_THUR, AR_FRI)- columns sa_ind - grep(SA_,columns) days - gsub(SA_,,

Re: [R] time conversions

2015-02-18 Thread Troels Ring
Thanks a lot and thanks to Rui Troels Den 18-02-2015 kl. 20:14 skrev peter dalgaard: On 18 Feb 2015, at 18:45 , Troels Ring tr...@gvdnet.dk wrote: dear friends - sorry to ask another simple question - I have dates set up as this: dates #[1] 2003-01-21 01:08:00 To handle it I did

Re: [R] Numerical stability of eigenvalue and hessian matrix in R

2015-02-18 Thread Jeff Newmiller
This question is getting pretty deep into numerical analysis theory. The usual approach has already been mentioned... don't expect high accuracy in all problems. Your specific problem could have a special technique somewhere, but don't be surprised if we are not experts in your specific

Re: [R] grepping out columns

2015-02-18 Thread David Winsemius
On Feb 18, 2015, at 12:27 PM, Kate Ignatius wrote: Hi, I've got a complicated grep problem (or not)... I currently have a file with the headings as follows: Lets assume these values are in a character vector named 'dat'. SA_TUES SA_MON SU_WED CH_TUES CH_WED CH_MON AR_TUES AR_WED

Re: [R] Numerical stability of eigenvalue and hessian matrix in R

2015-02-18 Thread C W
Thanks Thierry for the pointer, that's explains the problem. Is there anything I can do about the matrix instability or numerical inaccuracy? Mike On Wed, Feb 18, 2015 at 11:57 AM, Thierry Onkelinx thierry.onkel...@inbo.be wrote: Have a look at FAQ 7.31 ir. Thierry Onkelinx Instituut voor

[R] grepping out columns

2015-02-18 Thread Kate Ignatius
Hi, I've got a complicated grep problem (or not)... I currently have a file with the headings as follows: DAY MONTH YEAR SA_TUES SA_MON SU_WED CH_TUES CH_WED CH_MON AR_TUES AR_WED AR_MON SA_THUR SU_FRI CH_THUR CH_FRI AR_THUR AR_FRI I want to grep out all columns that have SA at the beginning

Re: [R] Numerical stability of eigenvalue and hessian matrix in R

2015-02-18 Thread David Winsemius
On Feb 18, 2015, at 1:13 PM, C W wrote: Thanks Thierry for the pointer, that's explains the problem. Is there anything I can do about the matrix instability or numerical inaccuracy? There are matrix methods in the Rmpfr package that support increased precision, but it is implemented with

Re: [R] Numerical stability of eigenvalue and hessian matrix in R

2015-02-18 Thread Spencer Graves
On Feb 18, 2015, at 1:54 PM, David Winsemius dwinsem...@comcast.net wrote: On Feb 18, 2015, at 1:13 PM, C W wrote: Thanks Thierry for the pointer, that's explains the problem. Is there anything I can do about the matrix instability or numerical inaccuracy? There are matrix methods

Re: [R] Numerical stability of eigenvalue and hessian matrix in R

2015-02-18 Thread Spencer Graves
On Feb 18, 2015, at 2:15 PM, Spencer Graves spencer.gra...@prodsyse.com wrote: On Feb 18, 2015, at 1:54 PM, David Winsemius dwinsem...@comcast.net mailto:dwinsem...@comcast.net wrote: On Feb 18, 2015, at 1:13 PM, C W wrote: Thanks Thierry for the pointer, that's explains the

[R] How do I know which package is loaded?

2015-02-18 Thread Aron Lindberg
Hi All, In short: what’s a good workflow for forking/rewriting/testing code in packages? I’m trying to contribute to a package on Github. So I fork it and then clone my forked repo into my desktop, and then I open the files I want to edit in RStudio. However, to actually test that the code

Re: [R] multiple parameter optimization with optim()

2015-02-18 Thread Prof J C Nash (U30A)
Some observations -- no solution here though: 1) the code is not executable. I tried. Maybe that makes it reproducible! Typos such as stat mod, undefined Q etc. 2) My experience is that any setup with a ?apply approach that doesn't then check to see that the structure of the data is correct

Re: [R] Numerical stability of eigenvalue and hessian matrix in R

2015-02-18 Thread Ben Bolker
C W tmrsg11 at gmail.com writes: Hi list, I am running the following R code, the answer should be zero. But R gives a very small negative number, what should I do? ##R code library(numDeriv) h_x - function(x){ a = x[1] b = x[2] c = x[3] d = x[4] (a^2 + c^2 + d^2) *

[R] coxphw with categorical explanatory variables

2015-02-18 Thread Simon Gingins
Dear R helpers, I am currently trying to analyze data with a cox proportional hazard survival analysis. For one of my datasets, the proportional hazards assumption is violated. Reading the literature, it seems that the weighted version of cox PH (function coxphw() ) is a good alternative in

[R] API request from R

2015-02-18 Thread Mittal Ashra via R-help
Dear All, Apologies for mailing it to the whole crowd. This is Mittal, presently working in a Project where we have build a platform for displaying recommendations and the results are based on the statistical models.  I have gone through the CRAN repository to look out for an package which

Re: [R] Substituting elements in vector

2015-02-18 Thread Knut Hansen
Tirsdag 17. februar 2015 15.50.27 skrev David Winsemius: On Feb 17, 2015, at 3:58 AM, Knut Hansen wrote: Dear list, I have a vector: my.vector - c(A, B, C, D, E, F, G) and two other: vec1 - c(p, q, r, s, t) vec2 - c(x, y, z) I want to substitute elements b and e in

Re: [R] Numerical stability of eigenvalue and hessian matrix in R

2015-02-18 Thread JS Huang
Hi, Since all entries in your hessian matrix and grad vector are integers, I suggest you execute the following for mat assignment. mat - round(h_x(x),digits=0)*round(hess.h,digits=0) - round(grad(h_x, x),digits=0) %o% round(grad(h_x, x),digits=0) mat [,1] [,2] [,3]

Re: [R] Help with declaring factors in a function

2015-02-18 Thread William Dunlap
You did not put the altered columns back into the data.frame, so glm() never saw them. Does the following work? func - function(x,y,z) { #x is a data frame #y is a formula for the regression #z vector of names of columns of x to convert to factors for (name in z) { x[[name]] -

[R] Help with declaring factors in a function

2015-02-18 Thread Evan Kransdorf
Hello, I am passing a df to a function and then want to declare factors (based on a vector of column names in the df) for a logistic regression. I am having trouble - R doesn't seem to recognize the factors as declared in the function? Below is my code. Does anyone have any ideas? MyFunction -

Re: [R] grepping out columns

2015-02-18 Thread Kate Ignatius
Thanks! That was helpful. Although I think there was a typo in the last line: selected - sort(unique(unlist(all_ind))) but I figured it out :) K. On Wed, Feb 18, 2015 at 4:10 PM, Federico Lasa fel...@gmail.com wrote: David's almost works except it catches the MONTH column, just add an