| vec_cast.tfd_reg | R Documentation |
vctrs methods for tf objectsThese functions are the extensions that allow tf vectors
to work with vctrs.
## S3 method for class 'tfd_reg'
vec_cast(x, to, ...)
## S3 method for class 'tfd_irreg'
vec_cast(x, to, ...)
## S3 method for class 'tfd_reg'
vec_cast.tfd_reg(x, to, ...)
## S3 method for class 'tfd_irreg'
vec_cast.tfd_reg(x, to, ...)
## S3 method for class 'tfb_spline'
vec_cast.tfd_reg(x, to, ...)
## S3 method for class 'tfb_fpc'
vec_cast.tfd_reg(x, to, ...)
## S3 method for class 'tfd_reg'
vec_cast.tfd_irreg(x, to, ...)
## S3 method for class 'tfd_irreg'
vec_cast.tfd_irreg(x, to, ...)
## S3 method for class 'tfb_spline'
vec_cast.tfd_irreg(x, to, ...)
## S3 method for class 'tfb_fpc'
vec_cast.tfd_irreg(x, to, ...)
## S3 method for class 'tfb_spline'
vec_cast(x, to, ...)
## S3 method for class 'tfb_fpc'
vec_cast(x, to, ...)
## S3 method for class 'tfb_spline'
vec_cast.tfb_spline(x, to, ...)
## S3 method for class 'tfb_fpc'
vec_cast.tfb_spline(x, to, ...)
## S3 method for class 'tfb_spline'
vec_cast.tfb_fpc(x, to, ...)
## S3 method for class 'tfb_fpc'
vec_cast.tfb_fpc(x, to, ...)
## S3 method for class 'tfd_reg'
vec_cast.tfb_spline(x, to, ...)
## S3 method for class 'tfd_irreg'
vec_cast.tfb_spline(x, to, ...)
## S3 method for class 'tfd_reg'
vec_cast.tfb_fpc(x, to, ...)
## S3 method for class 'tfd_irreg'
vec_cast.tfb_fpc(x, to, ...)
## S3 method for class 'tfd_reg'
vec_ptype2(x, y, ...)
## S3 method for class 'tfd_reg'
vec_ptype2.tfd_reg(x, y, ...)
## S3 method for class 'tfd_irreg'
vec_ptype2.tfd_reg(x, y, ...)
## S3 method for class 'tfb_spline'
vec_ptype2.tfd_reg(x, y, ...)
## S3 method for class 'tfb_fpc'
vec_ptype2.tfd_reg(x, y, ...)
## S3 method for class 'tfd_irreg'
vec_ptype2(x, y, ...)
## S3 method for class 'tfd_reg'
vec_ptype2.tfd_irreg(x, y, ...)
## S3 method for class 'tfd_irreg'
vec_ptype2.tfd_irreg(x, y, ...)
## S3 method for class 'tfb_spline'
vec_ptype2.tfd_irreg(x, y, ...)
## S3 method for class 'tfb_fpc'
vec_ptype2.tfd_irreg(x, y, ...)
## S3 method for class 'tfb_spline'
vec_ptype2(x, y, ...)
## S3 method for class 'tfb_spline'
vec_ptype2.tfb_spline(x, y, ...)
## S3 method for class 'tfb_fpc'
vec_ptype2.tfb_spline(x, y, ...)
## S3 method for class 'tfd_reg'
vec_ptype2.tfb_spline(x, y, ...)
## S3 method for class 'tfd_irreg'
vec_ptype2.tfb_spline(x, y, ...)
## S3 method for class 'tfb_fpc'
vec_ptype2(x, y, ...)
## S3 method for class 'tfb_spline'
vec_ptype2.tfb_fpc(x, y, ...)
## S3 method for class 'tfb_fpc'
vec_ptype2.tfb_fpc(x, y, ...)
## S3 method for class 'tfd_reg'
vec_ptype2.tfb_fpc(x, y, ...)
## S3 method for class 'tfd_irreg'
vec_ptype2.tfb_fpc(x, y, ...)
x |
Vectors to cast. |
to |
Type to cast to. If |
... |
For |
y |
Vectors to cast. |
Notes on vec_cast:
Use tf_rebase() to change the representations of tf-vectors,
these methods are only for internal use –
automatic/implicit casting of tf objects is tricky
because it's hard to determine automatically whether such an operation would
lose precision (different bases with different expressivity? different
argument grids?), and it's not generally clear which instances of which
tf-subclasses should be considered the "richer" objects.
Rules for casting:
If the casted object's domain would not contain the entire original domain,
no casting is possible (would lose data).
Every cast that evaluates (basis) functions on different arg values is a lossy cast,
since it might lose precision (vctrs::maybe_lossy_cast).
As long as the casted object's domain contains the entire original domain:
every tfd_reg, tfd_irreg or tfb can always be cast into an equivalent
tfd_irreg (which may also change its evaluator and domain).
every tfd_reg can always be cast to tfd_reg (which may change its evaluator and domain)
every tfb can be cast losslessly to tfd (regular or irregular,
note it's lossless only on the original arg-grid)
Any cast of a tfd into tfb is potentially lossy (because we don't know how expressive the chosen basis is)
Only tfb with identical bases and domains can be cast into one another losslessly
for vec_cast: the casted tf-vector, for vec_ptype2: the common prototype
vctrs::vec_cast(), vctrs::vec_ptype2()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.