Skip to content

Any polars class object is made of this

Description

One SEXP of Rtype: "externalptr" + a class attribute

Details

  • object$method() calls are facilitated by a $.ClassName- s3method see ‘R/after-wrappers.R’
  • Code completion is facilitated by .DollarNames.ClassName-s3method see e.g. ’R/dataframe\_\_frame.R’
  • Implementation of property-methods as DataFrame_columns() and syntax checking is an extension to $.ClassName See function macro_add_syntax_check_to_class().

Value

not applicable

Examples

library(polars)

# all a polars object is only made of:
some_polars_object = pl$DataFrame(iris)
str(some_polars_object) # External Pointer tagged with a class attribute.
#> Class 'RPolarsDataFrame' <externalptr>
# All state is stored on rust side.

# The single exception from the rule is class "GroupBy", where objects also have
# two private attributes "groupby_input" and "maintain_order".
str(pl$DataFrame(iris)$group_by("Species"))
#>  'RPolarsGroupBy' Named chr " "
#>  - attr(*, "private")=List of 3
#>   ..$ dat           :Class 'RPolarsDataFrame' <externalptr> 
#>   ..$ groupby_input :List of 1
#>   .. ..$ : chr "Species"
#>   ..$ maintain_order: logi FALSE