From edd at debian.org  Mon Jul  2 19:00:41 2012
From: edd at debian.org (Dirk Eddelbuettel)
Date: Mon, 2 Jul 2012 12:00:41 -0500
Subject: [Rd] Dependency problem for "hasArg"
In-Reply-To: <1341246198971-4635158.post@n4.nabble.com>
References: <4FF1B8E3.4050501@jrc.ec.europa.eu>
	<1341246198971-4635158.post@n4.nabble.com>
Message-ID: <20465.54201.303641.891734@max.nulle.part>


On 2 July 2012 at 09:23, Charlie Friedemann wrote:
| The error message you are getting makes it rather clear what the problem is. 
| R is unable to find the function 'hasArg'.  As the hasArg function is part
| of the package 'methods', a solution would be to put require(methods) at the
| beginning of your script.
| 
| For whatever reason, loading R via Rscript does not load the base package
| "methods" whereas loading the R console does. I'm not entirely sure why this
| is the case, and I'm sure someone who knows more about the differences
| between the two could chime in here.

That was a design decision in Rscript as loading 'methods' is slow.  And
FWIW, littler does the same:

  edd at max:~$ r -e'print(search())'
  [1] ".GlobalEnv"   "Autoloads"    "package:base"
  edd at max:~$ r -lmethods -e'print(search())'
  [1] ".GlobalEnv"      "package:methods" "Autoloads"       "package:base"   
  edd at max:~$ 

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



[Rd] Dependency problem for "hasArg"
Dirk Eddelbuettel