-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathS4_register.Rd
More file actions
29 lines (27 loc) · 1.08 KB
/
S4_register.Rd
File metadata and controls
29 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/S4.R
\name{S4_register}
\alias{S4_register}
\title{Register an R7 class with S4}
\usage{
S4_register(class, env = parent.frame())
}
\arguments{
\item{class}{An R7 class created with \code{\link[=new_class]{new_class()}}.}
\item{env}{Expert use only. Environment where S4 class will be registered.}
}
\description{
If you want to use and R7 class with S4 (e.g. to use \link{method<-} to register an
method for an S4 generic with an R7 class) you need to call \code{S4_register()}
once. This generates a full S4 class specification that:
\itemize{
\item Matches class name and inheritance hierarchy.
\item Uses \code{\link[=validate]{validate()}} as the validity method.
\item Defines formal S4 slots to match R7 properties. The slot types are
matched to the R7 property types, with the exception of R7 unions,
which are unchecked (due to the challenges of converting R7 unions to
S4 unions).
}
If \code{class} extends another R7 class or has a property restricted to an
R7 class, you you must register those classes first.
}