Skip to contents

Strip the multisitedgp_data class and attributes (design, diagnostics, provenance) and return a plain tbl_df. Useful when handing off to a downstream tool that should not see the multisiteDGP attributes.

Usage

# S3 method for class 'multisitedgp_data'
as_tibble(x, ..., .preserve_class = FALSE)

# S3 method for class 'multisitedgp_data'
x[i, j, ..., drop = FALSE]

Arguments

x

A multisitedgp_data object.

...

Passed to as_tibble.

.preserve_class

Logical. If TRUE, return x unchanged (preserves the class and attributes). Default FALSE.

i, j

Row and column indices passed to base subsetting.

drop

Included for base subsetting compatibility; multisiteDGP data objects use tibble-style non-dropping behavior.

Value

A plain tbl_df (with class and attributes stripped) unless .preserve_class = TRUE, in which case x is returned unchanged.

Functions

  • [: Subset data while preserving class only when canonical columns remain; row subsets drop stale diagnostics.

See also

Examples

dat <- sim_multisite(J = 10L, seed = 1L)
plain <- tibble::as_tibble(dat)
attributes(plain)   # only standard tibble attributes
#> $names
#> [1] "site_index" "z_j"        "tau_j"      "tau_j_hat"  "se_j"      
#> [6] "se2_j"      "n_j"       
#> 
#> $row.names
#>  [1]  1  2  3  4  5  6  7  8  9 10
#> 
#> $class
#> [1] "tbl_df"     "tbl"        "data.frame"
#>