[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  InternalMethods: Internal Generic Functions

##  Description

Many  R  -internal functions are _generic_ and allow methods to be written
for.

##  Arguments

##  Details

The following primitive and internal functions are _generic_ , i.e., you can
write ` [ methods ](/link/methods?package=base&version=3.6.2) ` for them:

` [ [ ](/link/%5B?package=base&version=3.6.2) ` ,  ` [ [[
](/link/%5B%5B?package=base&version=3.6.2) ` ,  ` [ $
](/link/%24?package=base&version=3.6.2) ` , ` [ [<-
](/link/%5B%26lt%3B-?package=base&version=3.6.2) ` , ` [ [[<-
](/link/%5B%5B%26lt%3B-?package=base&version=3.6.2) ` , ` [ $<-
](/link/%24%26lt%3B-?package=base&version=3.6.2) ` ,

` [ length ](/link/length?package=base&version=3.6.2) ` ,  ` [ length<-
](/link/length%26lt%3B-?package=base&version=3.6.2) ` ,  ` [ dimnames
](/link/dimnames?package=base&version=3.6.2) ` ,  ` [ dimnames<-
](/link/dimnames%26lt%3B-?package=base&version=3.6.2) ` ,  ` [ dim
](/link/dim?package=base&version=3.6.2) ` ,  ` [ dim<-
](/link/dim%26lt%3B-?package=base&version=3.6.2) ` ,  ` [ names
](/link/names?package=base&version=3.6.2) ` ,  ` [ names<-
](/link/names%26lt%3B-?package=base&version=3.6.2) ` ,  ` [ levels<-
](/link/levels%26lt%3B-?package=base&version=3.6.2) ` ,

` [ c ](/link/c?package=base&version=3.6.2) ` ,  ` [ unlist
](/link/unlist?package=base&version=3.6.2) ` ,  ` [ cbind
](/link/cbind?package=base&version=3.6.2) ` ,  ` [ rbind
](/link/rbind?package=base&version=3.6.2) ` ,

` [ as.character ](/link/as.character?package=base&version=3.6.2) ` , ` [
as.complex ](/link/as.complex?package=base&version=3.6.2) ` , ` [ as.double
](/link/as.double?package=base&version=3.6.2) ` , ` [ as.integer
](/link/as.integer?package=base&version=3.6.2) ` , ` [ as.logical
](/link/as.logical?package=base&version=3.6.2) ` , ` [ as.raw
](/link/as.raw?package=base&version=3.6.2) ` , ` [ as.vector
](/link/as.vector?package=base&version=3.6.2) ` ,  ` [ is.array
](/link/is.array?package=base&version=3.6.2) ` , ` [ is.matrix
](/link/is.matrix?package=base&version=3.6.2) ` , ` [ is.na
](/link/is.na?package=base&version=3.6.2) ` ,  ` [ is.nan
](/link/is.nan?package=base&version=3.6.2) ` ,  ` [ is.numeric
](/link/is.numeric?package=base&version=3.6.2) ` , ` [ rep
](/link/rep?package=base&version=3.6.2) ` ,  ` [ seq.int
](/link/seq.int?package=base&version=3.6.2) ` (which dispatches methods for `
"seq" ` )  and ` [ xtfrm ](/link/xtfrm?package=base&version=3.6.2) `

In addition, ` is.name ` is a synonym for ` [ is.symbol
](/link/is.symbol?package=base&version=3.6.2) ` and dispatches methods for the
latter. Similarly, ` [ as.numeric
](/link/as.numeric?package=base&version=3.6.2) ` is a synonym for ` as.double
` and dispatches methods for the latter, i.e., S3 methods are for ` as.double
` , whereas S4 methods are to be written for ` as.numeric ` .

Note that all of the [ group generic
](/link/group%20generic?package=base&version=3.6.2) functions are also
internal/primitive and allow methods to be written for them.

` .S3PrimitiveGenerics ` is a character vector listing the primitives which
are internal generic and not [ group generic
](/link/group%20generic?package=base&version=3.6.2) . Currently ` [ as.vector
](/link/as.vector?package=base&version=3.6.2) ` , ` [ cbind
](/link/cbind?package=base&version=3.6.2) ` , ` [ rbind
](/link/rbind?package=base&version=3.6.2) ` and ` [ unlist
](/link/unlist?package=base&version=3.6.2) ` are the internal non-primitive
functions which are internally generic.

For efficiency, internal dispatch only occurs on _objects_ , that is those for
which ` [ is.object ](/link/is.object?package=base&version=3.6.2) ` returns
true.

##  See Also

` [ methods ](/link/methods?package=base&version=3.6.2) ` for the methods
which are available.

Powered b