[Rd] Format printing inside a matrix

Jialin Ma m@r||n- @end|ng |rom gmx@cn
Tue Jul 2 07:35:54 CEST 2019

Hi everyone,

I am not sure if there is an existing solution to this, but I want my S4
objects inside a list matrix showing correctly. Currently it shows as:

R> str(lst[[1]])
Formal class 'Basic' [package "symengine"] with 1 slot
  ..@ ptr:<externalptr>
R> matrix(lst, 2)
     [,1] [,2] [,3] [,4] [,5]
[1,] ?    ?    ?    ?    ?
[2,] ?    ?    ?    ?    ?

Is it possible that the print method for matrix can call some type of generic
such as `as.character` or `format` when it encounters such cases? Or is there
any other place that I can override without introducing a new S3 class?

Jialin Ma

More information about the R-devel mailing list