Follow me
-
Recent Posts
calendar
December 2024 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Recent Comments
- Stan on python argparse issues with the help argument (TypeError: %o format: a number is required, not dict)
- Cormac on Pandas : how to compare dataframe with None
- LP on AWK: the substr command to select a substring
- jrab on python argparse issues with the help argument (TypeError: %o format: a number is required, not dict)
- How to disable SSL verification for urlretrieve? – Peter's blog on python: certificate verified failed
Archives
Categories
Meta
Tag Archives: R
Line starting ‘ …’ is malformed! error
Playing with a Python wrapper of an R package, I suddenly got this error after a trivial change of the code: Line starting ‘<!DOCTYPE html> …’ is malformed!Line starting ‘<!DOCTYPE html> …’ is malformed! Wondering for a couple of minutes … Continue reading
R package dependencies: difference between imports, depends, suggests, enhances
When you want to assemble R codes into a package, you will need to write a file called DESCRIPTION. This file contains some metadata and keywords to be used and some keywords are definitely confusing (at least to me). Here … Continue reading
Using valgrind to debug R programs
If you want to debug your R program because of a segmentation fault or memory leak, you can use valgrind as follows in a shell: R -d "valgrind –leak-check=full –show-reachable=yes" -f your_script.RR -d "valgrind –leak-check=full –show-reachable=yes" -f your_script.R
R warnings when starting rpy2 and installation
On Fedora 15 When I start rpy2 using this command import rpy2 from rpy2 import robjectsimport rpy2 from rpy2 import robjects I was getting these annoying warnings, which do not appear when starting a pure R session: During startup – … Continue reading
R language: object oriented programming
I’m used to object oriented programming in languages such as C++ and Python and I should say that the R syntax is not the most intuitive I’ve seen. Besides, it is quite difficult to find a good documentation about it. … Continue reading
How use R to build permutation or combination
In a previous post, I used itertools in Python to create combination and permutation using the standard module itertools. What about using R language to perform the same task. The permutation function allows you to get permutation of N values … Continue reading
Upgrading R and rpy2
When upgrading R version, you must recompile rpy2. Let us take a case study based on the upgrade of R2.15 to R2.15.1. First, you need to download the source from the main page http://www.r-project.org/ Once downloaded, get the source tar … Continue reading
How to call R plotting function from python using rpy2
Python has already very good librairies from plotting (e.g., matplotlib, mayavi), however, it is sometimes useful to use some of the plotting functionalities offered by R. Thanks to the rp2 package, it is quite easy. Let us try to use … Continue reading
installing rpy2 with different R version already installed
The easiest way to install a python package is to use easy_install (or pip), so to install rpy2, type: easy_install rpy2 To test that it is properly installed, type: import rpy2; from rpy2 import robjects; robjects.r(“version”) If this code works, … Continue reading
RPy2 substitute function does not work
I’m using rpy2 to call R package from Python, which works pretty well most of the time. Yet, I’ve encountered an issue with the R function called substitute that do not behave as expected when called from rpy2. Consider the … Continue reading