Displaying 20 results from an estimated 7000 matches similar to: "probably easy methods question"
2008 Feb 14
1
finding source for a function
Dear R Gurus:
How do you get source for functions which say "UseMethod" when you
type in their names, please?
I've tried getAnywhere and getMethods...I thought that might produce them.
Thanks in advance.
Sincerely,
Edna
2009 Mar 15
2
builtin vs. closure
Dear R Gurus:
I'm working slowly through "R Programming for Bioinformatics", which
is really interesting!
Anyway, my question now is: what determines if a function is a
builtin vs. a closure, please?
For instance:
> typeof(sqrt)
[1] "builtin"
> typeof(mean)
[1] "closure"
>
Thanks,
Edna Bell
2009 Sep 15
2
Viewing Function Code
Hi All,
I'd like to see the function code behind the barplots2() function in the
gplots package, however i come across a bit of a stumbling block of a hidden
function, can anyone help?
> library(gplots)
> methods(barplot2)
[1] barplot2.default*
Non-visible functions are asterisked
> barplot2
function (height, ...)
UseMethod("barplot2")
<environment:
2005 Jan 26
2
Source code for "extractAIC"?
Dear R users:
I am looking for the source code for the R function extractAIC. Type the
function name doesn't help:
> extractAIC
function (fit, scale, k = 2, ...)
UseMethod("extractAIC")
<environment: namespace:stats>
And when I search it in the R source code, the best I can find is in (R
source root)/library/stats/R/add.R:
extractAIC <- function(fit, scale, k = 2,
2013 Jan 13
2
getting TukeyHSD code
Hello R People:
Here's the Saturday night goofy question. I would like to see the
code for TukeyHSD function and I tried the following:
> getAnywhere("TukeyHSD")
A single object matching ?TukeyHSD? was found
It was found in the following places
package:stats
namespace:stats
with value
function (x, which, ordered = FALSE, conf.level = 0.95, ...)
2008 Jan 25
3
function code
R-help,
Sorry for this question (I guess it has been addressed before but
I could not find it in the archives)
but how can I see a function code
when the following comes up:
> svymean
function (x, design, na.rm = FALSE, ...)
{
.svycheck(design)
UseMethod("svymean", design)
}
<environment: namespace:survey>
Thanks in advance
2010 Mar 31
2
Printing the function t.test() in R
Dear R Users,
I have a question, how does one print an r function like t.test in R (to get
the whole function and not just a summary of the environment)? For example
if I type the following:
> t.test
function (x, ...)
UseMethod("t.test")
<environment: namespace:stats>
> print(t.test)
function (x, ...)
UseMethod("t.test")
<environment: namespace:stats>
I
2004 Sep 27
2
Getting code for functions
Hello
Pardon for the elementary question, I did try searching the archives
with various terms, but to no avail. I am using R1.9.1 on a windows
machine
One of the great advantages of R (to me, anyway) is being able to see
the code for a function , e.g. by typing sd one sees the code for
getting a standard deviation.
However, for many functions this only provides info. including
UseMethod, eg.
2023 Mar 19
1
ver el código de randomForest
Buenos días:
Otra opción es escribir directamente el nombre de la función en la
consola de R:
> randomForest
function (x, ...)
UseMethod("randomForest")
En este caso, la función randomForest() llama a UseMethod() para
seleccionar el método adecuado.
Podemos ver los métodos para randomForest con la función methods():
> methods(randomForest)
[1] randomForest.default*
2009 Sep 09
2
The code behind the function
Hi R users,
I have a question. How can I see the code behind the function. For example,
> boxplot
function (x, ...)
UseMethod("boxplot")
<environment: namespace:graphics>
I really would like to see how people code this. Could someone please show
me how to see the code behind the function?
Many Thanks
Tu
--
View this message in context:
2004 May 04
2
Seeing the definition of a function
Dear all,
I was trying to see how the function 'confint' is defined. Doing
> confint
function (object, parm, level = 0.95, ...)
UseMethod("confint")
<environment: namespace:stats>
does not really enlighten me. How can I get to see the implementation (I guess it should be possible according to the general philosophy of the R project)?
Thanks in advance
S??ren
2006 Apr 05
1
page() (Was: Re: predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall()))
Here I think S3 dispatch is very natural. Try the following:
page <- function(x, method = c("dput", "print"), ...) UseMethod("page")
page.getAnywhere <- function(x, ..., idx=NULL) {
name <- x$name;
objects <- x$obj;
if (length(objects) == 0)
stop("no object named '", name, "' was found");
if (is.null(idx)) {
2013 Aug 23
1
How to view the source of code?
Hi all R mailing listers:
I am using the coda package. I tried to view the source of HPDinterval code
by typing fix(HPDinterval), it dispalys as follows:
function (obj, prob = 0.95, ...)
UseMethod("HPDinterval")
Then I search the answers about this case (see below), it still failed.
Thank you in advance!
David
> getAnywhere('HPDinterval')2 differing objects matching
2006 Jun 06
1
Accessing lme source code
Dear all;
This an FAQ. I tried to access lme source script so I can step
into it to debug the problems resulting from a lme() call. I used
getAnywhere("lme") or nlme:::lme, both produced only the function
definition and "UseMethod("lme").
Any idea how to list the source code?
TIA,
Richard Yang
[[alternative HTML version deleted]]
2008 Jul 18
2
source code functions
>na.contiguous
function (object, ...)
UseMethod("na.contiguous")
<environment: namespace:stats>
this is what I get when I look for the source code for some functions- Is
there a way to look at the source code?
--
Let's not spend our time and resources thinking about things that are so
little or so large that all they really do for us is puff us up and make us
feel like
2009 Mar 20
1
classes and methods
I have put together a test class and methods
> setClass("foo",representation(x="numeric"))
[1] "foo"
> setMethod("plot","foo",function(x,y,...)boxplot(x,...))
[1] "plot"
> x <- rnorm(100)
> class(x) <- "foo"
> plot(x)
> y <- new("foo",x=rnorm(50))
> class(y)
[1] "foo"
My
2005 Jan 03
4
Inspecting R functions
In S-Plus, I can look at the structure of a function (for example, hist)
simply by entering
hist <RETURN>
however, if I do this in R, I get the response
function (x, ...)
UseMethod("hist")
<environment: namespace:graphics>
How can I inspect the structure of a function in R?
-------------------------------
Richard Dybowski
143 Village Way
2007 Jul 16
3
looking at a function's code
Good morning,
I'd like to look at the code for the R function head. When I type just the word head, I get back
function(x, ...)
UseMethod("head")
<environment: namespace:utils>
I expected to see several lines of R code. Any suggestions?
Thanks,
Walt Paczkowski
2007 Nov 28
2
[OT] putting URLs in Latex
Hi R Gurus!
This is definitely off topic, but I thought I'd try: what is the way
to put in url's into a Latex file, please?
I know that you start with a \newcommand statement, with some kind of
argument that will change, but I'm not sure how to set it up, please.
thanks,
Edna Bell
2009 Mar 19
8
function question
Dear R Gurus:
I read somewhere that functions are considered vectors.
Is this true, please?
thanks
Edna Bell