Displaying 20 results from an estimated 30000 matches similar to: "How to get the definition of a function if it is masked by a variable?"
2011 May 21
2
unbalanced anova with subsampling (Type III SS)
Hello R-users,
I am trying to obtain Type III SS for an ANOVA with subsampling. My design
is slightly unbalanced with either 3 or 4 subsamples per replicate.
The basic aov model would be:
fit <- aov(y~x+Error(subsample))
But this gives Type I SS and not Type III.
But, using the drop() option:
drop1(fit, test="F")
I get an error message:
"Error in
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
2011 Jan 04
5
scoping/non-standard evaluation issue
Dear r-devel list members,
On a couple of occasions I've encountered the issue illustrated by the
following examples:
--------- snip -----------
> mod.1 <- lm(Employed ~ GNP.deflator + GNP + Unemployed +
+ Armed.Forces + Population + Year, data=longley)
> mod.2 <- update(mod.1, . ~ . - Year + Year)
> all.equal(mod.1, mod.2)
[1] TRUE
>
> f <-
2010 Nov 07
2
How is MissInfo calculated? (mitools)
What does missInfo compute and how is it computed?
There is only 1 observation missing the ethnic3 variable. There is no other
missing data.
N=1409
> summary(MIcombine(mod1))
Multiple imputation results:
with(rt.imp, glm(G1 ~ stdage + female + as.factor(ethnic3) + u,
family = binomial()))
MIcombine.default(mod1)
results se
(lower upper)
2010 Jun 15
1
Problem with the recode function
Hello,
I am using the recode() function in Rcmdr and the result is not what I
expect so I am almost sure I did something wrong but what...
> test <- data.frame(x=1:10)
> library(car)
> recode(test$x,'1:5=0 ; else=1', as.factor.result=TRUE)
[1] 0 0 0 0 0 1 1 1 1 1
Levels: 0 1
BUT
> library(Rcmdr) # recode from the car package is now masked
Now I recode test$x
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
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
2010 Apr 25
1
problem with Rcmdr Plugins
Dear R Development People:
I have written a couple of plugins for Rcmdr and they do not seem to work with R-2.11.0.
Here is the output:
> library(RcmdrPlugin.epack)
Loading required package: Rcmdr
Loading required package: tcltk
Loading Tcl/Tk interface ... done
Loading required package: car
--- Please select a CRAN mirror for use in this session ---
Rcmdr Version 1.5-4
Attaching package:
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, ...)
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 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.
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
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,
2009 Jul 29
1
RFC: methods() and showMethods() {was "debug"}
(a new thread, on purpose)
>>>>> "RobG" == Robert Gentleman <rgentlem at fhcrc.org>
>>>>> on Mon, 27 Jul 2009 16:55:50 -0700 writes:
RobG> Hi, I just committed a change to R-devel so that if
RobG> debug is called on an S3 generic function, all methods
RobG> will also automatically have debug turned on for them
RobG>
2008 Sep 09
1
probably easy methods question
Dear R Gurus:
I want to look at the code for the t.test function. I did the following:
> t.test
function (x, ...)
UseMethod("t.test")
<environment: namespace:stats>
> getAnywhere("t.test")
A single object matching 't.test' was found
It was found in the following places
package:stats
registered S3 method for t from namespace stats
namespace:stats
with
1999 Jul 15
2
R: UseMethod with primitives?
Hello,
is the following somehow possible with Mod() being a primitive:
"Mod" <- function(x)
UseMethod("Mod")
"Mod.default" <- function(x) {
.Primitive("Mod") ### I know it?s wrong. How can I access the
original Mod ?
}
Thanks for help
M. Eger
--
+-------------------------------------------------------
| Marcus Eger
| Philipps Universitaet
2010 Feb 08
1
objects masked from packages
dear all,
I have a problem with a masked object in a package we created here.
we make a package for a workflow of internal analysis of microarray data.
to create the package we used:
> install.packages(pkgs="affyAnalysis", repos=NULL)
> R CMD INSTALL affyAnalysis
Erzeuge Verzeichnisse ...
Erzeuge DESCRIPTION ...
Erzeuge NAMESPACE ...
Erzeuge Read-and-delete-me ...
Kopiere
2005 Oct 18
3
Finding code for R functions
Greetings,
I am trying to figure out how to find the source code for R functions. I
am specifically interested in finding the code for the "prcomp"
function. I know that typing the function name without parenthesis will
lead to the code (or to a .Internal or .FORTRAN or .C call). However, I
don't really understand what is going on. For example, typing "mean"
gives a
2011 Mar 02
3
Rcommander
Dear Sirs,
i just downloaded the R programm on my Macbook, but I can´t open Rcmdr, although I installed the needed Rcmdr-packages. I would be very happy, if you could help me. Telephone: +49 151 10868600 (Germany) or e-mail
Yous sincerely,
Selda Korkmaz
sk@seldakorkmaz.com
www.seldakorkmaz.com
[[alternative HTML version deleted]]
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*