Giter Site home page Giter Site logo

pqR side by side with GNU-R about pqr HOT 8 OPEN

radfordneal avatar radfordneal commented on July 3, 2024
pqR side by side with GNU-R

from pqr.

Comments (8)

radfordneal avatar radfordneal commented on July 3, 2024

Hi. I take you've sucessfully compiled pqR, and then installed it (using --prefix) in a place other than your existing R. That is OK, but if you don't want to replace your existing R, you can also just compile pqR, and then use it from its build directory, without ever doing a "make install". See "INSTALL" in the main source directory for more details.

To get a different initialization with pqR than with your existing R, you could do various things, which are documented in help(Startup) within pqR (probably similarly for current R Core versions). It seems that you may want to set the R_PROFILE_USER environment variable, though putting something in $RHOME/etc/Rprofile.site also ought to work. I tried putting setwd("~/pqR") in Rprofile.site, and it works for me. I'm puzzled by your error message involving the neuralnet package. Do you do something with that package in your current Rprofile (which maybe got executed)?

Note that you need to install packages separately for pqR (which will go into the library directory in the pqR home directory, if you haven't done anything to change that). You shouldn't try to use the versions installed in another version of R.

Please let me know how it goes...

  Radford

from pqr.

beew avatar beew commented on July 3, 2024

Hi, there are two things involved apparently. First neuralnet was not even installed by pqR, which is easily fixed. The other is that when starting pqR without argument it is reading the .libPaths of R 3.3.1 with the correct one appended in the end (these are in my default .RProfile)

.libPaths()
[1] "/usr/lib/R/library"                         
[2] "/home/bee/R/x86_64-pc-linux-gnu-library/3.2"
[3] "/home/bee/opt/pqR/lib/R/library"    

But starting pqR with the --vanilla flag then the error goes away and it is reading the correct libPahs

.libPaths()
[1] "/home/bee/opt/pqR/lib/R/library"

But putting .libPaths("/home/bee/opt/pqR/lib/R/library") in $RHOME/etc/Rprofile.site does not change anything, pqR still reads the default .Rprofile for R3.3.1, neither does the setwd('~/pqR') have any effect.

from pqr.

radfordneal avatar radfordneal commented on July 3, 2024

You could put something like cat("Now executing blah, blah\n") in the various files that might be used as R profiles (with different blah, blah of course!) in order to get direct information about which profile(s) is actually being used. Also, have you set the environment variables R_PROFILE or R_PROFILE_USER? You could do the commands echo $R_PROFILE and echo $R_PROFILE_USER before starting pqR to be sure what they are.

Also, from help(Startup), it seems that .Rprofile in your home directory will be read if it exists and you haven't set R_PROFILE_USER (or .Rprofile in your current directory will be read).

from pqr.

beew avatar beew commented on July 3, 2024

Hi. I am not sure how to set the environmental variables R_PROFILE and R_PROFILE_USER. If I try to change that before I start pqR wouldn't that change the values for R 3.3.1? There is a file in pqR/lib/R/etc/Renviron. I guess I should add these two there, but I am not sure what the correct format is.

from pqr.

radfordneal avatar radfordneal commented on July 3, 2024

You can run a program with environment variables set to particular values by entering a shell command such as

A=x B=y prog

which runs 'prog' with environment variable A set to x and environment variable B set to y. This affects only this run of 'prog'.

But the easiest way for you to set things up may be to put the following in etc/Renviron.site in the pqR RHOME directory:

R_PROFILE_USER=~/pqR-profile

And in pqR-profile in your home directory, put whatever R commands you want done at startup.

from pqr.

beew avatar beew commented on July 3, 2024

Hi,

Creating Renviron.site and adding that line works, just exactly what I want. Thank you very much for your help and patience!

Oh, just wondering if there is something I can put in .pqR-profile so that it will download packages from pqR's repository by default instead of cran by just typing install.packages("foo") without specifying the repository.

from pqr.

radfordneal avatar radfordneal commented on July 3, 2024

You should be able to change the default package repository with

options(repos="ftp://price.utstat.utoronto.ca")

Let me know if you have any more questions!

  Radford

from pqr.

beew avatar beew commented on July 3, 2024

Hi, it all works now. Thanks very much for the help!

from pqr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.