[R] Confusion over syntax in a package

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Sep 25 21:33:17 CEST 2008


See ?getAnywhere , and the description of NAMESPACE in 'Writing R 
Extensions'.

getAnywhere("calc.dist") and ProbForecastGOP:::calc.dist  both work for 
me.

On Thu, 25 Sep 2008, Ryan Glover wrote:

> Hello,
>
> I am new to R and I am attempting to use the ProbForecastGOP package
> for some research I am conducting.
>
> The package works fine when I call the functions from the command line
> as the examples instruct.
>
> However, I am attempting to step through some of the functions so that
> I can obtain a better idea of what is going on.  I have come to the
> following command:
>
> calc.dist(coord1.day.index,coord2.day.index,id.day.index)
>
> I know what this is supposed to do, it is calculating the geographic
> distance between a series of latitude and longitude points.  However,
> I am informed by R that no such function exists.  I searched through
> the whole package for a function declaration, rooted through the R
> help and googled for the same and came up with nothing.  Interestingly
> there is a second command that also won't function on its own:
>
> calc.difference(gop.res.day)
>
> Same result, I cannot find any listing of a 'calc' function.
>
> The strange thing is that everything works fine when I run the example
> commands from the command lines, when the function is called instead
> of calling each line individually, it works perfectly.
>
> Can anyone shed light on what 'calc' may be?

Not calc, calc.dist.  I don't think there is a function calc() in the 
package.

> Many thanks,
> Ryan Glover
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list