Learn R Programming

ILSAmerge (version 1.3.6)

asthistibble: Copy tibble attributes

Description

Converts a data frame into a tibble copying all attributes.

Usage

asthistibble(tibble, x)

Value

A tibble.

Arguments

tibble

a tibble object.

x

a data frame with the same columns of tibble.

Examples

Run this code
# tibble generated by haven
input <- system.file("extdata/reds", package = "ILSAmerge")
tib <- do.call(rbind,justload(inputdir = input,population = "BCGV1"))

# Remove all tibble attributes
x <- tib
class(x) <- "data.frame"
for(i in 1:ncol(x)){
  attributes(x[,1]) <- NULL
}

# Mix variables 
set.seed(1919)
x <- x[,sample(ncol(x))]
head(x)[,1:10]
tib

asthistibble(tibble = tib, x = x)

Run the code above in your browser using DataLab