Similar to str() but with more information for Altrep objects.

vroom_str(x)

Arguments

x

a vector

Examples

# when used on non-altrep objects altrep will always be false vroom_str(mtcars)
#> 'data.frame': 32 obs., 11 vars.: #> $mpg: altrep:false type: double length:32 #> $cyl: altrep:false type: double length:32 #> $disp: altrep:false type: double length:32 #> $hp: altrep:false type: double length:32 #> $drat: altrep:false type: double length:32 #> $wt: altrep:false type: double length:32 #> $qsec: altrep:false type: double length:32 #> $vs: altrep:false type: double length:32 #> $am: altrep:false type: double length:32 #> $gear: altrep:false type: double length:32 #> $carb: altrep:false type: double length:32
mt <- vroom(vroom_example("mtcars.csv"), ",", altrep_opts = c("chr", "dbl"))
#> Observations: 32 #> Variables: 12 #> chr [ 1]: model #> dbl [11]: mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb #> #> Call `spec()` for a copy-pastable column specification #> Specify the column types with `col_types` to quiet this message
vroom_str(mt)
#> 'tbl_df', 'tbl', and 'data.frame': 32 obs., 12 vars.: #> $model: altrep:true type:vroom::vroom_chr length:32 materialized:false #> $mpg: altrep:true type:vroom::vroom_dbl length:32 materialized:false #> $cyl: altrep:true type:vroom::vroom_dbl length:32 materialized:false #> $disp: altrep:true type:vroom::vroom_dbl length:32 materialized:false #> $hp: altrep:true type:vroom::vroom_dbl length:32 materialized:false #> $drat: altrep:true type:vroom::vroom_dbl length:32 materialized:false #> $wt: altrep:true type:vroom::vroom_dbl length:32 materialized:false #> $qsec: altrep:true type:vroom::vroom_dbl length:32 materialized:false #> $vs: altrep:true type:vroom::vroom_dbl length:32 materialized:false #> $am: altrep:true type:vroom::vroom_dbl length:32 materialized:false #> $gear: altrep:true type:vroom::vroom_dbl length:32 materialized:false #> $carb: altrep:true type:vroom::vroom_dbl length:32 materialized:false