LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-19-2010, 07:30 PM   #1
zeratul111
LQ Newbie
 
Registered: Sep 2010
Posts: 19

Rep: Reputation: Disabled
Question R path?


Hello forum,

I have encountered the following error while running an application:

Quote:
Caused by: java.io.IOException: Cannot run program "R": java.io.IOException: error=2, No such file or directory
The above came after the following invocation, from the log file:
Quote:
Tue Oct 19 22:59:16 GMT 2010 Calling R CMD BATCH --profileFiles=/home2/jason/birdsuite/TEST_OUT/test.probeset_summary --outDir=/home2/jason/birdsuite/TEST_OUT --verbose=T --no-readline --priorsFile=/home2/jason/birdsuite/METADATADIR/GenomeWideSNP_6.canary_priors --offsetFile=/home2/jason/birdsuite/METADATADIR/GenomeWideSNP_6.canary_offsets /home2/jason/birdsuite/EXEDIR/canary.R /home2/jason/birdsuite/TEST_OUT/test.canary_log
I have 2 questions:
1. How do I define the path for R? (in bashrc for example) So that when I type "R" in the command line it'll know where to look instead of me typing out the entire path for R.

2. the canary.R file, above, contains the following at the beginning:
Quote:
#example:
# /broad/tools/bin/R CMD BATCH \
# profile="test.profile"
# method = "GMM"
# outDir = "out"
# verbose = T
I had originally thought that specifying the R path in this file would resolve the error, but no luck. Just wondering why specifying the R path in this .R file still lead to the unable to find R error?

Could anyone help me with these questions? Thanks very much!
 
Old 10-19-2010, 07:38 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,608

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Hi,

you could add the following line to your bashrc
Code:
export PATH=${PATH}:/path/to/R
Does it start correctly when you call it with its full path?
 
Old 10-19-2010, 07:55 PM   #3
zeratul111
LQ Newbie
 
Registered: Sep 2010
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by crts View Post
Hi,

you could add the following line to your bashrc
Code:
export PATH=${PATH}:/path/to/R
Does it start correctly when you call it with its full path?

Hi crts, thanks for your reply!

I added the path line you suggested to bashrc, but it still doesn't work when I invoke R without the full path, for example:
Quote:
$ R CMD INSTALL -l EXEDIR EXEDIR/broadgap.canary_1.0.tar.gz
-bash: R: command not found
As for the canary.R file, I added the full path in there where it stated the example, but it did not work. I can't really find any other file that invokes R directly that I can edit. I expect that the invocation is from the birdsuite.jar file, which I have no idea how to read/edit. So I thought if I can define "R" such that it contains the path to R, the problem may be solved (hopefully).

Thanks!

Last edited by zeratul111; 10-19-2010 at 07:57 PM.
 
Old 10-19-2010, 07:57 PM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,608

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
You did source .bashrc afterwards, right?
P.S.: So it does work when you call it from the commandline with full path, but not from within the script?

Last edited by crts; 10-19-2010 at 07:59 PM.
 
Old 10-19-2010, 08:00 PM   #5
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
You can't be serious. Are you programming for Android or what? If R.java is missing from Android.jar, you have a problem.
 
Old 10-28-2010, 11:49 AM   #6
zeratul111
LQ Newbie
 
Registered: Sep 2010
Posts: 19

Original Poster
Rep: Reputation: Disabled
Hi crts, I forgot to post an update to this thread. Your code actually worked, but in my original post I said that it didn't work because I stupidly included "/R" to the path...

Will mark thread as solved. Thanks so much!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script path issue - how to pass a path as a string to a variable PiNPOiNT Programming 5 04-17-2009 06:48 PM
set up java_home path in /home/user/.bashrc but use path in /usr/lib/java vitalstrike82 Slackware 4 01-14-2009 12:25 AM
Do you add to the path line or make a new path in /etc/profile? M$ISBS Linux - Newbie 2 12-13-2006 03:14 PM
script to change unix path to windows path in all files csross Programming 8 04-29-2006 02:05 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 07:10 PM


All times are GMT -5. The time now is 06:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration