Re: [Rpy] Find a new home for the main source repository

2019-08-26 Thread Luca Beltrame
In data venerdì 23 agosto 2019 12:51:06 CEST, Laurent Gautier ha scritto: Hello, > Atlassian has announced the end of support for Mercurial repositories, so > rpy2 will have to find a new home for its main source repository: You might want to look at sourcehut.org. -- Luca Beltrame

Re: [Rpy] Py3 build failure

2014-02-27 Thread Luca Beltrame
In data giovedì 27 febbraio 2014 17:22:57, Luca Beltrame ha scritto: > There are several others like this, same error string. I fixed it by setting proper CFLAGS (CFLAGS=-std=c99), so perhaps it may have been a local issue. -- Luca Beltrame, Ph.D. Translational Genomics Unit, Department

[Rpy] Py3 build failure

2014-02-27 Thread Luca Beltrame
:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] PyObject *key = PyLong_FromVoidPtr((void *)object); ^ There are several others like this, same error string. -- Luca Beltrame, Ph.D. Translational Genomics Unit, Department of Oncology IRCCS

Re: [Rpy] Is the AGP still making sense ?

2013-11-27 Thread Luca Beltrame
of which is more "comfortable" for a given community. -- Luca Beltrame, Ph.D. Translational Genomics Unit, Department of Oncology IRCCS Istituto di Ricerche Farmacologiche "Mario Negri" signature.asc Description: Thi

Re: [Rpy] Crash upon import with newer R (3.0.2)

2013-09-27 Thread Luca Beltrame
In data venerdì 27 settembre 2013 14:13:24, Laurent Gautier ha scritto: > I am sure I can have the time to work on this over the week-end. In case > I don't, please make sure there is an entry about the issue in bitbucket > (so it is not forgotten). Done, issue #150. -- Luca

Re: [Rpy] Crash upon import with newer R (3.0.2)

2013-09-27 Thread Luca Beltrame
In data venerdì 27 settembre 2013 11:10:13, Luca Beltrame ha scritto: > R --version > R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" > Copyright (C) 2013 The R Foundation for Statistical Computing > Platform: x86_64-suse-linux-gnu (64-bit) Reverting to R 3.0.1 fixes the

Re: [Rpy] Crash upon import with newer R (3.0.2)

2013-09-27 Thread Luca Beltrame
In data venerdì 27 settembre 2013 11:13:08, Luca Beltrame ha scritto: > FYI, the rpy2 version is the latest available (2.3.7). Minimal testing case that shows the problem: import rpy2.rinterface as rinterface rinterface.initr() rinterface.baseenv.get("file") -- Luca B

Re: [Rpy] Crash upon import with newer R (3.0.2)

2013-09-27 Thread Luca Beltrame
In data venerdì 27 settembre 2013 11:10:13, Luca Beltrame ha scritto: > R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" FYI, the rpy2 version is the latest available (2.3.7). -- Luca Beltrame, Ph.D. Translational Genomics Unit, Department of Oncology IRCCS Istituto di Ricerche F

[Rpy] Crash upon import with newer R (3.0.2)

2013-09-27 Thread Luca Beltrame
;s a bug or just a local error)? -- Luca Beltrame, Ph.D. Translational Genomics Unit, Department of Oncology IRCCS Istituto di Ricerche Farmacologiche "Mario Negri" signature.asc Description: This is a digitally signed message part. ---

Re: [Rpy] Addition to R vectors not behaving as expected (as in R)

2013-03-21 Thread Luca Beltrame
ssue to use .ro (I do in several other places for selection). – Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute signature.asc Description: This is a digitally signed m

[Rpy] Addition to R vectors not behaving as expected (as in R)

2013-03-21 Thread Luca Beltrame
This occurs with the latest 2.3. Example case: robjects.IntVector([0,1,2]) + 1 This is what it returns [ 0,1,2,1] While I'd expect, like in R > c(0,1,2) + 1 [1] 1 2 3 Is this a bug, or do I have to do things differently? -- Luca Beltra

Re: [Rpy] importr regression in 2.3?

2013-03-12 Thread Luca Beltrame
kegg_env = graphite.__rdata__.fetch("kegg (pathways)") > kegg = kegg_env['kegg'] I did something similar using wherefrom(), in fact. -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute signature.asc Description: This is

Re: [Rpy] importr regression in 2.3?

2013-03-12 Thread Luca Beltrame
attr(graphite, "kegg") Out[6]: True In [8]: rpy2.__version__ Out[8]: '2.2.5' – Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute signature.asc Description: This is a digitally signed message part. -

Re: [Rpy] importr regression in 2.3?

2013-03-12 Thread Luca Beltrame
In data martedì 12 marzo 2013 17:03:26, Luca Beltrame ha scritto: > This package provides a series of classes, in this case I wanted to access > the "kegg" class. Just as a small correction, it's a R "list" containing classes. It's present in the package e

[Rpy] importr regression in 2.3?

2013-03-12 Thread Luca Beltrame
ovides a series of classes, in this case I wanted to access the "kegg" class. With 2.2.x, this graphite.kegg worked while in 2.3.x causes AttributeError. Where I can start digging to find the problem? -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negr

Re: [Rpy] How to plot pandas DataFrames and their numpy columns with Rpy2?

2013-02-11 Thread Luca Beltrame
ne I wrote. Laurent, if you make a release containing that converter soon, I'll make a PR to pandas to use that code path. This will mean of course that newer pandas will have to require that specific version of rpy2. -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department

Re: [Rpy] Sending named parameters to pypher?

2013-01-10 Thread Luca Beltrame
On Thu, 10 Jan 2013 20:00:44 +0100 (CET), Samuel Lampa wrote: > Ah, many thanks! :) A comment: if you're using R just to do a hypergeometric test, probably the R-Python overhead is not worth the effort. Scipy has the exact same function, with the advantage that you don't have to go through

[Rpy] Is it possible to assign whole columns of DataFrames?

2012-04-16 Thread Luca Beltrame
96 self._parent.__sexp__ = res.__sexp__ RRuntimeError: Error in [[<-.data.frame`(list(src = c(NA, NA, NA, NA, NA, NA, NA, NA, : argument "values" is missing, with no default It looks like a limitation on rpy2's part, as both approaches work in pure R. -- Luc

[Rpy] Adding columns to DataFrames

2012-02-24 Thread Luca Beltrame
"3", "4", : argument "value" is missing, with no default Anything I'm doing wrong? Or is there a more efficient way? (For reference, I'm trying to *avoid* creating taggedlists and so on because they involve intermediates, and with large objects that

Re: [Rpy] From matrices to data.frames and vice versa

2011-11-28 Thread Luca Beltrame
(I assume that similarly, "as_matrix" would work). -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute signature.asc Description: This is a digitally signed message part. --

Re: [Rpy] From matrices to data.frames and vice versa

2011-11-28 Thread Luca Beltrame
return res At least on my applications, which make use of importr() quite a lot, I notice that there is a significant (but unscientifically observed) delay when using importr(). If the code is already using it somewhere else in the same module, then it would not matter, however (at least IMO).

Re: [Rpy] From matrices to data.frames and vice versa

2011-11-28 Thread Luca Beltrame
Matrix, this messes up the column order (rows become columns). To be precise, the code I *tried* to use: kv = [(k, v) for k, v in tlist.iteritems()] kv = tuple(kv) df = baseenv_ri.get("data.frame").rcall(kv, globalenv_ri) super(DataFrame, self).__init__(df) which doesn't rea

Re: [Rpy] From matrices to data.frames and vice versa

2011-11-25 Thread Luca Beltrame
have a separate parameter to construct an instance from a Matrix. - it is preferable using a class/static method to create a DataFrame from a matrix (e.g. DataFrame.from_matrix) Opinions? -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute signature.

Re: [Rpy] RS4Auto_Type example throws an exception

2011-11-25 Thread Luca Beltrame
In data venerdì 25 novembre 2011 09:59:13, Luca Beltrame ha scritto: > Weird. For reference, I have python 2.7 (distro-supplied), R 2.14 (packaged, > but self compiled) and rpy 2.2.4 (self compiled). I'm happy to report that it was a local installation issue: recompiling rpy2 fixed i

Re: [Rpy] From matrices to data.frames and vice versa

2011-11-25 Thread Luca Beltrame
ame): def __init__(self, tlist=None, matrix=None): then going on. If this is a sensible design, I can try cooking up something and doing a pull request on bitbucket later on. -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute signature.asc Des

Re: [Rpy] RS4Auto_Type example throws an exception

2011-11-25 Thread Luca Beltrame
rtualenv (checking both the 2.2 and the unstable version) to see if I can replicate the issue. If I do, I'll start debugging the loop that collects the method names to see why it's generating an empty vector. -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mar

[Rpy] RS4Auto_Type example throws an exception

2011-11-24 Thread Luca Beltrame
ll_methods.do_slot("names"), all_methods): Further debugging has shown that all_methods is empty. Should I file a bug, or is it likely a local install problem? -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Ins

[Rpy] S4 methods: Problem with rpy2, or PEBKAC?

2011-11-24 Thread Luca Beltrame
n Python 2.7 w/rpy2 2.2 (the latest available verison), self compiled, and R 2.14. -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute signature.asc Description: This is a digitally signed message part. ---

[Rpy] From matrices to data.frames and vice versa

2011-11-24 Thread Luca Beltrame
("base") and then use the functions defined there. -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute signature.asc Description: This is a digitally signed message part.

Re: [Rpy] How to access aggregate date text?

2011-10-13 Thread Luca Beltrame
In data venerdì 14 ottobre 2011 04:07:36, William T. Martin ha scritto: > How do I access/capture the month headers? What kind of object is it? if it's a named vector, or similar (list, etc.), you can use the "names" attribute to get a vector of the names. -- L

Re: [Rpy] What is the equivalent of %in% in rpy2?

2011-09-12 Thread Luca Beltrame
In data lunedì 12 settembre 2011 11:45:32, Luca Beltrame ha scritto: > I forgot to add that I had to change the code to use list comprehensions > instead of generators, because otherwise I'd get a ValueError with "The > object does not have a length." (on rpy 2.2.x).

Re: [Rpy] What is the equivalent of %in% in rpy2?

2011-09-12 Thread Luca Beltrame
In data lunedì 12 settembre 2011 11:07:42, Luca Beltrame ha scritto: > Thanks Laurent, that did it. I forgot to add that I had to change the code to use list comprehensions instead of generators, because otherwise I'd get a ValueError with "The object does not have a length.&q

Re: [Rpy] What is the equivalent of %in% in rpy2?

2011-09-12 Thread Luca Beltrame
In data lunedì 12 settembre 2011 10:55:33, Laurent Gautier ha scritto: > from rpy2.robjects.vector import BoolVector > select_b = BoolVector(x in differential for x in source.rx2('gene')) > mysubset = source.rx(select_b, True) Thanks Laurent, that did it. -- Luca Beltrame, Ph

[Rpy] What is the equivalent of %in% in rpy2?

2011-09-12 Thread Luca Beltrame
Hello, in R I'm using something like this expression: mysubset <- source[source$gene %in% differential, ] where "differential" is a vector and "source" a dataframe. How can I replicate the use of %in% in rpy2? Thanks. -- Luca Beltrame, Ph.D. - Translational Genom

[Rpy] Substituting items in rpy2, R-style

2011-07-26 Thread Luca Beltrame
bug or am I doing something wrong? Thanks. -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute signature.asc Description: This is a digitally signed message part. --

Re: [Rpy] Strangeness with R.home

2011-05-25 Thread Luca Beltrame
In data mercoledì 25 maggio 2011 18:18:17, hai scritto: > $ R RHOME > $ echo R_HOME Found the issue, and it's unrelated to rpy2. In Ubuntu (and possibly Debian), "R" is a shell wrapper, and sets R_DOC_DIR as /usr/share/R/doc on startup. Sorry for the noise. -

[Rpy] Strangeness with R.home

2011-05-25 Thread Luca Beltrame
usr/share/R/doc" (correct) I suspect some changes on Ubuntu packages, as on my main openSUSE system (self packaged R) the first output (Python) is correct. How can that be possible? (rpy2.2 RC) -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri

Re: [Rpy] How to accsee a column data by using Rpy2?

2011-04-26 Thread Luca Beltrame
_function('%s$specified_column_name" % data_table)) # > This is no good. Doesn't work properly You should use "importr" and call the functions directly from Python. See the rpy2 documentation for more details. Hope this helps. -- Luca Beltrame, P

[Rpy] "Rownames" attribute of Matrix instances

2011-04-13 Thread Luca Beltrame
Hello, while working with Matrix instances (rpy 2.1.9) I noticed that the rownames attribute is read-only and can't be set (unlike the corresponding attribute of DataFrame). Was it by design, or just a slip? -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department,

Re: [Rpy] Replacement operations in matrices and data frames

2011-04-06 Thread Luca Beltrame
In data giovedì 7 aprile 2011 07:23:41, Laurent ha scritto: > rpy2-2.2.x is believed to be more convenient to use. I can only > encourage to already use it instead of 2.1.9. Are there any API incompatibilities with 2.1.x or is it a drop-in replacement? -- Luca Beltrame, Ph.D. - Transla

Re: [Rpy] Replacement operations in matrices and data frames

2011-04-05 Thread Luca Beltrame
In data martedì 5 aprile 2011 12:11:09, Moritz Beber ha scritto: > I'm almost convinced there must be a better way but I haven't found one yet. According to what I found in the documentation, it is possible in rpy 2.2 but not in 2.1.x. Laurent, am I correct? -- Luca B

[Rpy] Replacement operations in matrices and data frames

2011-04-05 Thread Luca Beltrame
ks in advance. -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute signature.asc Description: This is a digitally signed message part. -- Xperia(TM) PLAY It's a major breakthr

Re: [Rpy] rpy2-2.2.0-alpha4

2011-03-28 Thread Luca Beltrame
(lists, for example). The former is important to me because I will be able to reduce the number of kludges in my code. -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute signature.asc Description: This is a digitally signed m

Re: [Rpy] rpy2-2.2.0-alpha4

2011-03-27 Thread Luca Beltrame
In data domenica 27 marzo 2011 22:54:31, Laurent ha scritto: > The next tag will be rpy2-2.2.0beta and will already become the default > package on Pypi. How does 2.2 fare in terms of stability? The new features it has make it a worthwhile candidate for some projects I'm starting just now, hence

[Rpy] R "list" with rpy2

2010-12-20 Thread Luca Beltrame
nother.value") in Python I would use: my_list = robjects.StrVector(["some.value", "another.value"]) my_list.names = ["a", "b"] Is this the right approach or is there a better way? -- Luca Beltrame, Ph.D. - luca.beltr...@unifi.it Post-doctoral rese

Re: [Rpy] 2.1.0 last call for reporting issues before the release

2010-04-19 Thread Luca Beltrame
Speaking of "issues" (which I consider minor) in 2.1.x I found at the moment, it is not possible to pass format parameters when saving a DataFrame object (i.e. the R equivalents "sep, row.names, quote" and so on). Should I file a bug report (on which tracker?) so that it doesn't get lost? sign

Re: [Rpy] rpy2 and bioconductor

2010-04-16 Thread Luca Beltrame
In data venerdì 16 aprile 2010 07:37:45, hai scritto: > I pushed a version 0.2.1 to Pypi that fixes that. I just downloaded the 0.2.1 tarball from PyPI and apparently geoquery.py (or equivalent) is not present. It is present in the repository now, though, so I'll fetch it from there.

Re: [Rpy] rpy2 and bioconductor

2010-04-14 Thread Luca Beltrame
In data venerdì 9 aprile 2010 16:19:19, Laurent ha scritto: > Thanks. Glad to read this seems somehow useful. One question on that: the documentation mentions a "bioc.geoquery" module, but this is missing in the distributed tarball. Was that an oversight, or is it correct? Than

Re: [Rpy] rpy2 and bioconductor

2010-04-07 Thread Luca Beltrame
In data venerdì 2 aprile 2010 22:03:57, Laurent ha scritto: Hello, > There is documentation at: > http://packages.python.org/rpy2-bioconductor-extensions/ This really rocks. Thanks for creating it. -- Luca Beltrame, Ph.D. - luca.beltr...@unifi.it Post-doctoral research fellow -

[Rpy] rpy2.1 beta1+: problems with translated parameters

2010-03-18 Thread Luca Beltrame
parameter = {"length.out":2} sequence = list(base.seq(-10, 0, **parameter)) len(sequence) Result: 2 # Correct Is this a bug? If so, where should I report it? -- Luca Beltrame, Ph.D. - luca.beltr...@unifi.it Post-doctoral research fellow - Duccio Cavalieri group Department of Pharmacology, U

[Rpy] Handling null results

2010-02-24 Thread Luca Beltrame
unless I do: importr("base") base.is_null(test_list.rx2("c")) True Is there another way to go around this problem or should I stick with this solution for now? Thanks. -- Luca Beltrame, Ph.D. - luca.beltr...@unifi.it Post-doctoral research fellow - Duccio Cavalieri group De

[Rpy] Subset behavior - rpy 2.1.x

2010-02-18 Thread Luca Beltrame
d I handle such a case? Thanks! -- Luca Beltrame, Ph.D. Post-doctoral research fellow - Duccio Cavalieri group Department of Pharmacology, University of Firenze signature.asc Description: This is a digitally signed message p

Re: [Rpy] Access to R lists

2010-02-09 Thread Luca Beltrame
ame") and get the actual value. .rx is equivalent to [value] .rx2 is equivalent to [[value]] -- Luca Beltrame, Ph.D. Post-doctoral research fellow - Duccio Cavalieri group Department of Pharmacology, University of Firenze signature.asc Description: This is a digitally s

Re: [Rpy] More questions: attrs() and *apply functions

2010-01-19 Thread Luca Beltrame
cause it's part of the base R, but I was actually referring to "dendrapply", a variant (in stats) that is used to do the same on dendrograms (I use it to color them). As the result is a R object (a dendrogram) I guess I'll keep using the "r" instance for that fo

[Rpy] More questions: attrs() and *apply functions

2010-01-19 Thread Luca Beltrame
e, 1, my_function) Or is there a better way? Thanks! -- Luca Beltrame, Ph.D. - luca.beltr...@unifi.it Post-doctoral research fellow - Duccio Cavalieri group Department of Pharmacology, University of Firenze signature.asc

[Rpy] Attribute "rownames" of DataFrame

2010-01-18 Thread Luca Beltrame
constructing a DataFrame now only sets the numeric progression in the rownames attribute and thus causes problems. Are there technical reasons for this, and how to work it around? -- Luca Beltrame, Ph.D Post-doctoral research fellow - Duccio Cavalieri group Department of Pharmacology, Univer

Re: [Rpy] "which" command - translation into RPy 2.1

2010-01-18 Thread Luca Beltrame
e useful for other people as well. -- Luca Beltrame, Ph.D. Post-doctoral research fellow - Duccio Cavalieri group Department of Pharmacology, University of Firenze signature.asc Description: This is a digitally signed mess

[Rpy] "which" command - translation into RPy 2.1

2010-01-18 Thread Luca Beltrame
in R): length(which(keys == mydata$label)) (mydata is a R list - hence I would be able to use the .rx2 accessor) Has anyone got a hint on how to translate this using rpy 2.1.x? Thanks! -- Luca Beltrame, Ph.D. Post-doctoral research fellow - Duccio Cavalieri group Department of Pharmacolog

[Rpy] Handling NAs in data.frames and vectors

2010-01-15 Thread Luca Beltrame
x27;m running a local copy of rpy2 2.1 as I still have a system- wide 2.0.x needed for some projects. -- Luca Beltrame, Ph.D. Post-doctoral research fellow - Duccio Cavalieri group Department of Pharmacology, University of Firenze signature.asc Description: This is a digitally signed message pa