The R Project SVN R

Rev

Rev 61433 | Rev 67997 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61433 Rev 66580
Line 1... Line 1...
1
% File src/library/methods/man/showMethods.Rd
1
% File src/library/methods/man/showMethods.Rd
2
% Part of the R package, http://www.R-project.org
2
% Part of the R package, http://www.R-project.org
3
% Copyright 1995-2007 R Core Team
3
% Copyright 1995-2014 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{showMethods}
6
\name{showMethods}
7
\alias{showMethods}
7
\alias{showMethods}
8
\title{Show all the methods for the specified function(s)}
8
\title{Show all the methods for the specified function(s)}
Line 116... Line 116...
116
    methods(class = "Matrix")# nothing
116
    methods(class = "Matrix")# nothing
117
showMethods(class = "Matrix")# everything
117
showMethods(class = "Matrix")# everything
118
showMethods(Matrix:::isDiagonal) # a non-exported generic
118
showMethods(Matrix:::isDiagonal) # a non-exported generic
119
}%end{dontrun}
119
}%end{dontrun}
120
 
120
 
121
%% FIXME: This should be an example of showing methods from a loaded,
121
%% An example of showing methods from a loaded,
122
%% but not attached namespace. Except it doesn't work.
122
%% but not attached namespace.
123
%% Much simpler situation of attach()ing when needed:
-
 
124
not.there <- !any("package:stats4" == search())
123
if(no4 <- is.na(match("stats4", loadedNamespaces())))
125
if(not.there) library(stats4)
124
   loadNamespace("stats4")
126
showMethods(classes = "mle")
125
showMethods(classes = "mle") # -> a method for show()
127
if(not.there) detach("package:stats4")
126
if(no4) unloadNamespace("stats4")
128
}
127
}
129
\keyword{methods}
128
\keyword{methods}