convert types to an antsMatrix

as.antsMatrix(object, elementtype = "float", ...)

# S4 method for class 'list'
as.antsMatrix(object, elementtype = "float")

# S4 method for class 'data.frame'
as.antsMatrix(object, elementtype = "float")

# S4 method for class 'matrix'
as.antsMatrix(object, elementtype = "float")

Arguments

object

An object

elementtype

e.g. "float" or "double"

...

other parameters

Examples

as.antsMatrix(matrix(rnorm(10), nrow = 2))
#> An object of class "antsMatrix"
#> Slot "elementtype":
#> [1] "float"
#> 
#> Slot "pointer":
#> <pointer: 0x600000101200>
#> 
mat <- matrix(rnorm(10), nrow = 2)
df <- as.data.frame(mat)
as.antsMatrix(df)
#> An object of class "antsMatrix"
#> Slot "elementtype":
#> [1] "float"
#> 
#> Slot "pointer":
#> <pointer: 0x600000104c00>
#> 
as.antsMatrix(as.list(df))
#> An object of class "antsMatrix"
#> Slot "elementtype":
#> [1] "float"
#> 
#> Slot "pointer":
#> <pointer: 0x6000001055c0>
#>