Re: [R-es] r python interfaz

2018-04-05 Thread Fernando Arce via R-help-es
El jue, 5/4/18, Carlos Ortega <c...@qualityexcellence.es> escribió: Asunto: Re: [R-es] r python interfaz Para: "Jesús Para Fernández" <j.para.fernan...@hotmail.com> CC: "Freddy Omar López Quintero" <freddy.lopez.quint...@gmail.com>, "r-help-es" <

Re: [R-es] r python interfaz

2018-04-05 Thread Javier Marcuzzi
Estimados Cambio el enfoque, el sistema operativo es Linux, r es el que se puede instalar sin pagar nada a ninguna empresa, python es el que tiene Linux, la base de datos es mysql, maria, postgresql, los datos llegan por rest escrito en python en conjunto con nginx o apache. ¿Qué usar en python

Re: [R-es] r python interfaz

2018-04-05 Thread Carlos Ortega
R sigue funcionando como los de esta foto... pero hay algunas empresas como "RStudio" que están ordenando el aparente caos. https://twitter.com/seathebass/status/872499220850278400 Y en particular con respeto a la integración de R-Python, creo que sin el avance que ha supuesto "re

Re: [R-es] r python interfaz

2018-04-05 Thread Fernando Arce via R-help-es
Hola: Reticulate no requiere de RStudio para su utilizacion. Aunque en los comentarios del blog de RStudio hay una persona que dice que no funciona como deberia, y otro usuario le responde preguntando que version de RStudio tiene instalada, porque hace falta tener como minimo la "daily 1.2

Re: [R-es] r python interfaz

2018-04-04 Thread Javier Marcuzzi
Estimado Freddy Desconozco si solo funciona en Rstudio, por un lado es bueno como los aportes de revolution que hoy pasaron y continúan con Microsoft, por el otro lado se crean como sub-mundos de R, lógicamente si se dispone de dinero se puede comprar SQL server adquiriendo tecnología

Re: [R-es] r python interfaz

2018-04-04 Thread Freddy Omar López Quintero
La herramienta seguramente es buena; pero a mí particularmente no deja de sorprenderme el cisma que desde RStudio se está provocando en el sentido que ya casi ni usamos R sino R + X, donde X es cualquiera cosa que produzca RStudio, aún cuando esto duplique/ignore/arrebate/pase por alto/opaque el

[R-es] r python interfaz

2018-04-04 Thread Javier Marcuzzi
Estimados Recuerdo que hace unos años en esta lista con uno de los Carlos se había creado un hilo sobre R y python, hoy leo una noticia, por lo menos para mí, que podría entrar en esa situación entre lo mejor de dos alternativas. Lógicamente, es nuevo para mí, no puedo opinar nada más que

Re: [R] [Python] NameError: name 'hurst' is not defined

2017-02-13 Thread Jeff Newmiller
This question is off topic here. -- Sent from my phone. Please excuse my brevity. On February 13, 2017 9:08:18 AM PST, Allan Tanaka wrote: >Correction, it should look like this:**def hurst(ts): lags = range(2, >100) tau = [np.sqrt(std(subtract(ts[lag:], ts[:-lag])))

Re: [R] [Python] NameError: name 'hurst' is not defined

2017-02-13 Thread Allan Tanaka
Correction, it should look like this:**def hurst(ts): lags = range(2, 100) tau = [np.sqrt(std(subtract(ts[lag:], ts[:-lag]))) for lag in lags] poly = np.polyfit(log(lags), log(tau), 1) return poly[0]*2.0 On Tuesday, 14 February 2017, 0:06, Allan Tanaka wrote:

[R] [Python] NameError: name 'hurst' is not defined

2017-02-13 Thread Allan Tanaka
Hi. Not sure why this code produces the error like this. This error appears when i run the code of print "Hurst(GBM):   %s" % hurst(gbm):  Traceback (most recent call last):  File "", line 1, in     print "Hurst(GBM):   %s" % hurst(gbm)NameError: name 'hurst' is not defined Here is

[R] Python difflib R equivalent?

2011-07-28 Thread Paul
Hi, Does anyone know of a R library that is equivalent in functionality to the Python standard libraries' difflib library? The python docs say this about difflib: This module provides classes and functions for comparing sequences. It can be used for example, for comparing files, and can produce

Re: [R] Python difflib R equivalent?

2011-07-28 Thread Bert Gunter
Paul: 1. I do not know if any such library exists. 2. However, if I understand correctly, one usually does this sort of thing in R with functions like ?match (or ?%in%) and logical comparison operations like ?== . Of course, for numeric comparisons, you need to be aware of R FAQ 7.31 If you

Re: [R] Python difflib R equivalent? -- Correction

2011-07-28 Thread Bert Gunter
Item 1 below should be changed to: 1. I do not know if any such PACKAGE exists. (A library in R is a file directory where R packages are stored) -- Bert On Thu, Jul 28, 2011 at 8:05 AM, Bert Gunter bgun...@gene.com wrote: Paul: 1. I do not know if any such library exists. 2. However, if

Re: [R] Python difflib R equivalent?

2011-07-28 Thread Prof Brian Ripley
On Thu, 28 Jul 2011, Bert Gunter wrote: Paul: 1. I do not know if any such library exists. Not to my knowledge, and we have contemplated providing such functions. But for files see e.g. tools::Rdiff, and generally R will not be a good way to do this sort of thing on files (since the

Re: [R] Python difflib R equivalent?

2011-07-28 Thread Spencer Graves
There is a package rJython, which claims to provide an R interface to Python via Jython. I haven't used it, but the lead author, Gabor Grothendieck, is well known in the R community. Spencer On 7/28/2011 9:15 AM, Prof Brian Ripley wrote: On Thu, 28 Jul 2011, Bert Gunter wrote: Paul: 1.

Re: [R] python-like dictionary for R

2011-01-01 Thread Petr Savicky
On Fri, Dec 31, 2010 at 04:07:07PM -0800, Martin Morgan wrote: [...] Better to use an environment (and live with reference semantics) e - new.env(parent=emptyenv()); t0 - Sys.time() for (i in seq_len(1e6)) { key - as.character(i) e[[key]] - i if (0 == i %% 1)

Re: [R] python-like dictionary for R

2010-12-31 Thread Martin Morgan
On 12/30/2010 02:30 PM, Paul Rigor wrote: Thanks gang, I'll work with named vectors and concatenate as needed. This might be ok for small problems, but concatenation is an inefficient R pattern -- the objects being concatenated are copied in full, so becomes longer, and the concatenation

Re: [R] python-like dictionary for R

2010-12-30 Thread Paul Rigor
Thanks gang, I'll work with named vectors and concatenate as needed. Paul On Thu, Dec 23, 2010 at 7:39 AM, Seth Falcon s...@userprimary.net wrote: On Wed, Dec 22, 2010 at 7:05 PM, Martin Morgan mtmor...@fhcrc.org wrote: On 12/22/2010 05:49 PM, Paul Rigor wrote: Hi, I was wondering if

Re: [R] python-like dictionary for R

2010-12-23 Thread Seth Falcon
On Wed, Dec 22, 2010 at 7:05 PM, Martin Morgan mtmor...@fhcrc.org wrote: On 12/22/2010 05:49 PM, Paul Rigor wrote: Hi, I was wondering if anyone has played around this this package called rdict? It attempts to implement a hash table in R using skip lists. Just came across it while trying to

[R] python-like dictionary for R

2010-12-22 Thread Paul Rigor
Hi, I was wondering if anyone has played around this this package called rdict? It attempts to implement a hash table in R using skip lists. Just came across it while trying to look for simpler text manipulation methods: http://userprimary.net/posts/2010/05/29/rdict-skip-list-hash-table-for-R/

Re: [R] python-like dictionary for R

2010-12-22 Thread Phil Spector
Paul - You can also use named vectors as something similar to a python dictionary: nvec = c('one'=20,'two'=30,'three'=40) nvec['four'] = 50 nvec['one'] one 20 nvec['four'] four 50 Although the result is named, it can be used as a regular R value: 20 + nvec['three'] three 60 If

Re: [R] python-like dictionary for R

2010-12-22 Thread Martin Morgan
On 12/22/2010 05:49 PM, Paul Rigor wrote: Hi, I was wondering if anyone has played around this this package called rdict? It attempts to implement a hash table in R using skip lists. Just came across it while trying to look for simpler text manipulation methods:

[R] R-Python group on LinkedIn

2010-04-04 Thread Harsh
Dear R users, I'd like to invite interested members to join the LinkedIn group for R-Python (RPy). http://www.linkedin.com/e/vgh/2925347/eml-grp-sub/ This group seeks to bring like minded users together, for sharing knowledge\resources to encourage the use of RPy. I apologize

Re: [R] python

2009-11-22 Thread Romain Francois
On 11/21/2009 11:32 PM, Stefan Evert wrote: My hunch is that Python and R run at about the same speed, and both use C libraries for speedups (Python primarily via the numpy package). That's not necessarily true. There can be enormous differences between interpreted languages, and R appears

Re: [R] python

2009-11-22 Thread Stefan Evert
Sure, badly written R code does not perform as well as well written python code or C code. On the other hand badly written python code does not perform as well as well written R code. What happens when you try one of these : sum - sum( 1:N ) R runs out of memory and crashes. :-) I didn't

Re: [R] python

2009-11-22 Thread Jean Legeande
Thank you Gabor, Romain and Stefan. Gabor this looks like really interesting for speeding up loops. I just have to install it and add jit(1) before a loop ! Is the result faster than Python ? I have seen the name of L. Tierney among the contributors. I guess it is good for MCMC :-) Best, Jean

Re: [R] python

2009-11-22 Thread Peter Ehlers
Stefan Evert wrote: Sure, badly written R code does not perform as well as well written python code or C code. On the other hand badly written python code does not perform as well as well written R code. What happens when you try one of these : sum - sum( 1:N ) R runs out of memory and

Re: [R] python

2009-11-22 Thread Jean Legeande
Anyway I think it was just a toy example. Any additionnal information is welcome. Best, Jean 2009/11/22 Peter Ehlers ehl...@ucalgary.ca Stefan Evert wrote: Sure, badly written R code does not perform as well as well written python code or C code. On the other hand badly written python

[R] python

2009-11-21 Thread Jean Legeande
Dear R users, I would like to make my R code for MCMC faster. It is possible to integrate C code into R but I think C is too complicated for me. I would need a C introduction only for MCMC and I do not know if such a thing exists. I was thinking of Python (and scipy). Where could I read about

Re: [R] python

2009-11-21 Thread Paul Hiemstra
Hi Jean, You can integrate R and Python using RSPython or Rpy. But why would Python be faster than R? Both are interpreted languages and probably about as fast (please someone correct me if I'm wrong). It probably only help if there is a C mcmc implementation linked to python (that you link

Re: [R] python

2009-11-21 Thread Barry Rowlingson
On Sat, Nov 21, 2009 at 2:29 PM, Jean Legeande jean.legea...@gmail.com wrote: Dear R users, I would like to make my R code for MCMC faster. It is possible to integrate C code into R but I think C is too complicated for me. I would need a C introduction only for MCMC and I do not know if such

Re: [R] python

2009-11-21 Thread Patrick Burns
One little thing that I think Barry meant to say. If the bottleneck is in your code, you may be able to improve the situation enough by merely rewriting the R code of your function. If that doesn't work, then you can move to C. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696

Re: [R] python

2009-11-21 Thread Jean Legeande
Thank you Paul, Barry and Patrick. I will do what you recommand (the profiling). I have heard several times that for example Matlab would be faster than R... This is why I thought of switching to Python, though it is also interpreted. I thought it would be faster. Best, Jean 2009/11/21 Patrick

Re: [R] python

2009-11-21 Thread Whit Armstrong
We have been using pymc as an alternative to WinBUGS, and have been very pleased with it. I've begun working on an R2Pymc package, but don't have anything ready for sharing yet. Here's the pymc page: http://code.google.com/p/pymc/ and the repo is here: http://github.com/pymc-devs/pymc I've

Re: [R] python

2009-11-21 Thread Jean Legeande
Thank you Whit. So you have experience with both R and Python ? How do they compare ? Best, Jean 2009/11/21 Whit Armstrong armstrong.w...@gmail.com We have been using pymc as an alternative to WinBUGS, and have been very pleased with it. I've begun working on an R2Pymc package, but don't

Re: [R] python

2009-11-21 Thread Stefan Evert
My hunch is that Python and R run at about the same speed, and both use C libraries for speedups (Python primarily via the numpy package). That's not necessarily true. There can be enormous differences between interpreted languages, and R appears to be a particularly slow one (which

Re: [R] python

2009-11-21 Thread Jean Legeande
Thank you Stefan. That's really interesting. My guess is that Python is not much more complicated to program than R, and that we can integrate some codes into R. If it can be 10 times faster, that's great ! Best, Jean 2009/11/21 Stefan Evert stefan.ev...@uos.de My hunch is that Python and R

Re: [R] python

2009-11-21 Thread Gabor Grothendieck
There is work going on on two byte compilers for R: http://www.stat.uiowa.edu/~luke/R/compiler/ http://www.milbo.users.sonic.net/ra You could check whether running under either of those speeds up your R code sufficiently that you don't need to rewrite it. On Sat, Nov 21, 2009 at 9:29 AM, Jean

[R] Interview: Jon Peck on SPSS, R ,Python ...

2009-03-17 Thread Ajay ohri
Dear List, I recently got the chance to interview Jon Peck of SPSS Inc, a pioneering technical statistician working since 1983 (when there were only two substantial statistical software companies as per him ;) (not anymore ;) and currently he is a Principal Software Engineer and Technical Advisor

Re: [R] Python and R

2009-02-21 Thread Douglas Bates
Different methods of performing least squares calculations in R are discussed in @Article{Rnews:Bates:2004, author = {Douglas Bates}, title= {Least Squares Calculations in {R}}, journal = {R News}, year = 2004, volume = 4, number = 1, pages

Re: [R] Python and R

2009-02-20 Thread Kenn Konstabel
Decyphering formulas seems to be the most time consuming part of lm: mylm1 - function(formula, data) { # not perfect but works F - model.frame(formula,data) y - model.response(F) mt - attr(F, terms) x - model.matrix(mt,F) coefs - solve(crossprod(x), crossprod(x,y))

Re: [R] Python and R

2009-02-20 Thread Gabor Grothendieck
Note that using solve can be numerically unstable for certain problems. On Fri, Feb 20, 2009 at 6:50 AM, Kenn Konstabel lebats...@gmail.com wrote: Decyphering formulas seems to be the most time consuming part of lm: mylm1 - function(formula, data) { # not perfect but works F -

Re: [R] Python and R

2009-02-19 Thread Esmail Bonakdarian
Doran, Harold wrote: lm(y ~ x-1) solve(crossprod(x), t(x))%*%y# probably this can be done more efficiently You could do crossprod(x,y) instead of t(x))%*%y that certainly looks more readable (and less error prone) to an R newbie like myself :-)

Re: [R] Python and R

2009-02-19 Thread Esmail Bonakdarian
Hi Kenn, Thanks for the suggestions, I'll have to see if I can figure out how to convert the relatively simple call to lm with an equation and the data file to the functions you mention (or if that's even feasible). Not an expert in statistics myself, I am mostly concentrating on the

Re: [R] Python and R

2009-02-19 Thread Esmail Bonakdarian
Gabor Grothendieck wrote: On Wed, Feb 18, 2009 at 7:27 AM, Esmail Bonakdarian esmail...@gmail.com wrote: Gabor Grothendieck wrote: See ?Rprof for profiling your R code. If lm is the culprit, rewriting your lm calls using lm.fit might help. Yes, based on my informal benchmarking, lm is the

Re: [R] Python and R

2009-02-19 Thread Gabor Grothendieck
On Thu, Feb 19, 2009 at 8:30 AM, Esmail Bonakdarian esmail...@gmail.com wrote: Hi Kenn, Thanks for the suggestions, I'll have to see if I can figure out how to convert the relatively simple call to lm with an equation and the data file to the functions you mention (or if that's even

Re: [R] Python and R

2009-02-18 Thread Gabor Grothendieck
On Tue, Feb 17, 2009 at 6:59 PM, Esmail Bonakdarian esmail...@gmail.com wrote: Well, I have a program written in R which already takes quite a while to run. I was just wondering if I were to rewrite most of the logic in Python - the main thing I use in R are its regression facilities - if it

Re: [R] Python and R

2009-02-18 Thread Barry Rowlingson
2009/2/17 Esmail Bonakdarian esmail...@gmail.com: Well, I have a program written in R which already takes quite a while to run. I was just wondering if I were to rewrite most of the logic in Python - the main thing I use in R are its regression facilities - if it would speed things up. I

Re: [R] Python and R

2009-02-18 Thread Esmail Bonakdarian
Gabor Grothendieck wrote: See ?Rprof for profiling your R code. If lm is the culprit, rewriting your lm calls using lm.fit might help. Yes, based on my informal benchmarking, lm is the main bottleneck, the rest of the code consists mostly of vector manipulations and control structures. I

Re: [R] Python and R

2009-02-18 Thread Gabor Grothendieck
On Wed, Feb 18, 2009 at 7:27 AM, Esmail Bonakdarian esmail...@gmail.com wrote: Gabor Grothendieck wrote: See ?Rprof for profiling your R code. If lm is the culprit, rewriting your lm calls using lm.fit might help. Yes, based on my informal benchmarking, lm is the main bottleneck, the rest

Re: [R] Python and R

2009-02-18 Thread Kenn Konstabel
lm does lots of computations, some of which you may never need. If speed really matters, you might want to compute only those things you will really use. If you only need coefficients, then using %*%, solve and crossprod will be remarkably faster than lm # repeating someone else's example #

Re: [R] Python and R

2009-02-18 Thread Doran, Harold
lm(y ~ x-1) solve(crossprod(x), t(x))%*%y# probably this can be done more efficiently You could do crossprod(x,y) instead of t(x))%*%y __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] Python and R

2009-02-17 Thread Esmail Bonakdarian
Hello all, I am just wondering if any of you are doing most of your scripting with Python instead of R's programming language and then calling the relevant R functions as needed? And if so, what is your experience with this and what sort of software/library do you use in combination with

Re: [R] Python and R

2009-02-17 Thread Warren Young
Esmail Bonakdarian wrote: I am just wondering if any of you are doing most of your scripting with Python instead of R's programming language and then calling the relevant R functions as needed? No, but if I wanted to do such a thing, I'd look at Sage: http://sagemath.org/ It'll give you

Re: [R] Python and R

2009-02-17 Thread Barry Rowlingson
is: Python from rpy import r Python r.sum(x) ? Knuth's remark on premature optimization applies, as ever Barry __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Python and R

2009-02-17 Thread Esmail Bonakdarian
Hello! On Tue, Feb 17, 2009 at 5:58 PM, Warren Young war...@etr-usa.com wrote: Esmail Bonakdarian wrote: I am just wondering if any of you are doing most of your scripting with Python instead of R's programming language and then calling the relevant R functions as needed? No, but if I

Re: [R] Python and R

2009-02-17 Thread Esmail Bonakdarian
Rpy2 (which I've not got into yet). Google for rpy for info. Will do! Is there much of a performance hit either way? (as both are interpreted languages) Not sure what you mean here. Do you mean is: R sum(x) faster than Python sum(x) and how much worse is: Python from rpy import r