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
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
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
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
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
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
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))
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 -
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 :-)
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
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
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
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
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
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
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
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
#
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
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
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
the two together, it's easiest with 'rpy'. This
lets you call R functions from python, so you can do:
from rpy import r
r.hist(z)
to get a histogram of the values in a python list 'z'. There are some
complications converting structured data types between the two but
they can be overcome
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
On Tue, Feb 17, 2009 at 6:05 PM, Barry Rowlingson
b.rowling...@lancaster.ac.uk wrote:
2009/2/17 Esmail Bonakdarian esmail...@gmail.com:
When I need to use the two together, it's easiest with 'rpy'. This
lets you call R functions from python, so you can do:
from rpy import r
r.hist(z
23 matches
Mail list logo