R stores its environment setting in ~/.Renviron and history setting in ~/.Rhistory. If one have problems with R, try deleting them.
Not reading the correct R package
~/.Renviron and ~/.Rhistory. I do not think the second file matters, but delete it anyway.
You need to add some command line options to gcc or otherwise it cannot compile R packages.
For example, you get this error during compilation
gcc -shared -L/usr/local/lib -o wavesim.so bell-p-w.o dwt2.o dwt3.o dwt.o hoskin.o -lg2c -lm -lgcc_s -L/usr/local/lib/R/lib -lR Error : -lg2c is not valid
and you know that libg2c.a and libg2c.la is available in another directory, say /usr/lib/gcc/i386-redhat-linux/3.4.6
Create a ~/.R/Makevars file with the appropriate PKG_FLAGS (-I flags) and PKG_LIBS (-L and -l flags) settings.
For the example above, ~/.R/Makevars will look like this:
PKG_LIBS=-L/usr/lib/gcc/i386-redhat-linux/3.4.6
Note: It certainly looks like the –configure-vars or –configure-args is a possible alternative. However, I (co224) have no luck using them.
6.3.3 Customizing package compilation under Unix The R system and package-specific compilation flags can be overridden or added to by setting the appropriate Make variables in the personal file $HOME/.R/Makevars-$R_PLATFORM, or if that does not exist, $HOME/.R/Makevars, where `R_PLATFORM' is the platform for which R was built, as available in the platform component of the R variable R.version.
(Section 6.4) Some variables that may be used include: DEBUG=T to compile with debugging information for gdb. PKG_CFLAGS= to specify options to the C compiler. PKG_CPPFLAGS= to specify options to the preprocessor. PKG_CXXFLAGS= to specify options to the C++ compiler. PKG_FFLAGS= to specify options to the FORTRAN 77 compiler. PKG_FCFLAGS= to specify options to the Fortran 95 compiler (if specified). PKG_LIBS= to specify options to the linking step making the DLL. PKGDIR=/path/to/source to specify the path to the package source files. RLIB=/path/to/library to specify the path to the library where the package should be installed.