Using R

Has anybody used the OpenSuse R packages?

RichardET wrote:

>
> Has anybody used the OpenSuse R packages?
>
Yes (btw what is the question?)

Is there an interface for R under Linux? Or is it a language which I must link to an existng C/C++ development interface?

Thanks.

It’s a standalone program. There’s a command line interface, although Wikipedia says there are some GUI interfaces too.

http://en.wikipedia.org/wiki/R_(programming_language)

ken yap wrote:

>
> It’s a standalone program. There’s a command line interface, although
> Wikipedia says there are some GUI interfaces too.
>
> http://en.wikipedia.org/wiki/R_(programming_language)
>
>
It is a programming language (S plus like). The standalone program R is the
interpreter shell for the language.

I do not know if there is a C++ interface for R (R itself is written in a
scheme dialect). There is an incredible amount of third party packages
available via CRAN.

CRAN provides a package for interoperability with java (I used it once for
for accessing databases from within R via jdbc - it is in my opinion better
than the R odbc package and to program a gui for my R script).

You can compare it to the python interpreter (not the language and what it
does but the principle).

rkward is a gui for R (it was available in the repos till 11.0).

Hope that helps a bit.

What do you want to use it for?
Are you looking for statistics libraries for C++?

I am a SAS power user, but other than SAS JMP, which is $1600 for a lifetime license,( I have been to some training on JMP, it is a wonderful system, but 1600 is still quite high), SAS itself is too expensive for personal use or to develop a small consultancy without a major software investment, perhaps $8,000 to $10,000 first year license for SAS. Of course this price reflects what the costs are for the Windows version and would include SAS base, SAS macro, SAS Stat and SAS Access. SAS on Linux is much higher as they price it very differently. R seems to be a natural competitor to SAS as result, hence my interest in learning it. An interesting blog is

SAS and R

I also found the links for the packages for Opensuse on CRAN:

http://cran.r-project.org/bin/linux/suse/README.html

RichardET wrote:

>
> I am a SAS power user, but other than SAS JMP, which is $1600 for a
> lifetime license,( I have been to some training on JMP, it is a
> wonderfulsystem), SAS itself is too expensive for personal use or to
> develop a small consultancy without a major software investment, perhaps
> $8,000 to $10,000 first year license for SAS. Of course this price
> reflects what the costs are for the Windows version and would include
> SAS base, SAS macro, SAS Stat and SAS Access. SAS on Linux is much
> higher as they price it very differently. R seems to be a natural
> competitor to SAS as result, hence my interesting learning it. An
> interesting blog is
>
> ‘SAS and R’ (http://sas-and-r.blogspot.com/)
>
>
I think R is a pretty good alternative because it has “industrial strength”
power. I know a small company near where I am living which does
pharmaceutical studies for some large pharma trust here in germany which
uses R for everything they do in statistics.

My own experience in R is more limited, it is a casual tool for me (the
company I work for makes medical database applications). From time to time I
have the need to create scripts which do statistics based on the content of
our databases and have to interact with the relational database directly and
have to be able to invoke some of our java libraries. The good
interoperability with java and databases is the main reason for me to use R.
R has of course some learning curve (at least this was my experience).

If scripting in R is an option for you (it is what I prefer not to use a gui
but to program) and if you do not need to do everything via a gui, R is
clearly a first class tool. It also has a very good graphics system and as
said before an incredible amount of third party tools via the CRAN system.

If you need in addition something more light weighted which is more gui
related you may also have a look at Gnu PSPP which tries to be compatible
with SPSS. I never used PSPP myself, but since I am looking at the moment
for a tool for some colleagues who are no programmers and need to do
statistics it seems to be a really interesting thing. But it seems not yet
as mature as Gnu R.
I will give PSPP a try during the next few weeks (I need to develop an in
house training about elementary statistics with our databases for some of
our staff and for that casual users without programming experience R will be
overkill).

Just as a follow up:

I downloaded rkward tarball from sourceforge

http://sourceforge.net/projects/rkward/files/Current_Stable_Releases/rkward-0.5.2.tar.gz/download

and compiled it (version 0.5.2 for kde 4). Needed of course some devel
packages but everything went smooth.

It looks good and promising as R gui (last time I looked at it was at least
3 or 4 years ago and it was not very stable at that time).

Martin Helm wrote:

> I do not know if there is a C++ interface for R (R itself is written in a
> scheme dialect).

One should never say something simply from what is in the own memory. I have
to correct myself. Looking into the source code it is mostly written in C.
Then I tried to find out why I came to the conclusion it is written in
scheme and realized that the docs say the R language is somehow influenced
by scheme not that it is written in scheme.

Sorry, I just want to correct this.

RichardET wrote:
> Is there an interface for R under Linux? Or is it a language which I
> must link to an existng C/C++ development interface?

There are several GUIs that allow you to use certain subset of commands,
similar to SPSS.
You probably should take a look a Rcommander (Rcmdr)
http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/
or Rkward
http://rkward.sourceforge.net/

Last time I tried these, it seemed that Rcmdr could do many more things than
Rkward (which seemed to be at an earlier stage of development).
Cheers
-G-

Hi

I installed R from the openSUSE website. The problem is that package installation doesn’t work for packages requiring compilation. I get the following error message:

  • installing source package ‘vegan’ …
    ** libs
    sh: make: command not found
    ERROR: compilation failed for package ‘vegan’
  • removing ‘/home/openSUSE/R/i686-pc-linux-gnu-library/2.12/vegan’

The downloaded packages are in
‘/tmp/RtmpKnENQg/downloaded_packages’
Warning message:
In install.packages(“vegan”) :
installation of package ‘vegan’ had non-zero exit status

So, does any of you guys know how to solve this problem?

The funny thing is that package installation works just fine in the Windows command line version run with Wine, but I would still prefer to run the program directly in openSUSE.

Thanks

You need to install the gcc compiler and make at least. The easiest solution
is to install the base development pattern, you can do it from the shell
with


su -
zypper in -t pattern devel_basis


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.5 | nVidia
ION | 3GB Ram

martin_helm wrote:
> You need to install the gcc compiler and make at least.

That really should be a [build/install] dependency of the R package or
any other package that needs to be built. Shouldn’t it?

Dave Howorth wrote:

> martin_helm wrote:
>> You need to install the gcc compiler and make at least.
>
> That really should be a [build/install] dependency of the R package or
> any other package that needs to be built. Shouldn’t it?

Not really since the R package system has nothing to do with the R package
or the rpm system. You do not need any development environment to install
the R base package and to use R, but you will need it if you use the package
system which is built into R itself to compile downloaded R packages. What
you need then of course depends on the package in question (there are
several hundreds available in CRAN).


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.1 | nVidia
ION | 3GB Ram

martin_helm wrote:
> Not really since the R package system has nothing to do with the R package
> or the rpm system. You do not need any development environment to install
> the R base package and to use R, but you will need it if you use the package
> system which is built into R itself to compile downloaded R packages. What
> you need then of course depends on the package in question (there are
> several hundreds available in CRAN).

Ah, thanks for the clarification. One of the complexities of mixing
package systems then. CPAN gets around the C compiler issue by pointing
out the dependency when you configure cpan, but from what you say the
requirements of the R packaging system are more variable, which would
imply it might benefit from its own dependency management system.

Dave Howorth wrote:
> Ah, thanks for the clarification. One of the complexities of mixing
> package systems then. CPAN gets around the C compiler issue by pointing
> out the dependency when you configure cpan, but from what you say the
> requirements of the R packaging system are more variable, which would
> imply it might benefit from its own dependency management system.
I was wrong with the few hundreds (there are >3300 packages on CRAN) and yes
the dependencies are very different. I only know the few packages I used,
there are some depending on java, some depend on different databases, some
on complete external systems like GNU Octave some on special graphics
libraries and so on.
They would for sure benefit from their own dependency tracking (and they do
it for dependencies where one R package depends on another R package but not
really for external dependencies). I just think they do not have the
manpower to implement this for all kind of operating systems and their
different ways to handle software installations.
So the only solution I can see for the moment is to try to install it and
look where it breaks to see what is missing until everything is found and
installed to make the package build work (similar to compiling a software
from source where it is also sometimes not completely clear what to install
even if some parts can be found in a readme/install file).


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.1| nVidia
ION | 3GB Ram

Hi Martin

I installed the base development pattern, but now I get a different error:

  • installing source package ‘vegan’ …
    ** libs
    gfortran -fpic -fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -c cepin.f -o cepin.o
    make: gfortran: Command not found
    make: *** [cepin.o] Error 127
    ERROR: compilation failed for package ‘vegan’

I looked for “fortran” packages in the repositories and installed gcc-fortran and libgfortran, but I still get the same error.

mbtdl wrote:

>
> Hi Martin
>
> I installed the base development pattern, but now I get a different
> error:
>
>> * installing source package ‘vegan’ …
>> ** libs
>> gfortran -fpic -fomit-frame-pointer -fmessage-length=0 -O2 -Wall
>> -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables
>> -fasynchronous-unwind-tables -g -c cepin.f -o cepin.o
>> make: gfortran: Command not found
>> make: *** [cepin.o] Error 127
>> ERROR: compilation failed for package ‘vegan’
>>
>>
>
> I looked for “fortran” packages in the repositories and installed
> gcc-fortran and libgfortran, but I still get the same error.
>
When you open a terminal an type the two commands


gfortran --version
which gfortran

what do you get?
gcc-fortran was the correct package for it so I wonder what might be wrong.


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.1 | nVidia
ION | 3GB Ram

I just quickly tested


install.packages("vegan")

in my R installation and it succeeded without problems. Not sure what is
wrong on your system, can you also provide the output from


rpm -qa 'R-*'
rpm -qa 'gcc*'


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.1 | nVidia
ION | 3GB Ram

Hi

None of the two commands detected any version. So I installed gcc-fortran from “Install/Remove Software” (rather than from opensuse.org) and now everything is working fine. Thank you very much, Martin.