cols_condense()
takes a spec object and condenses its definition by setting
the default column type to the most frequent type and only listing columns
with a different type.
spec()
extracts the full column specification from a tibble
created by readr.
cols_condense(x) spec(x)
x | The data frame object to extract from |
---|
A col_spec object.
df <- read_csv(readr_example("mtcars.csv"))#> Error in read_csv(readr_example("mtcars.csv")): could not find function "read_csv"s <- spec(df)#> Error: inherits(x, "tbl_df") is not TRUEs#> Error in eval(expr, envir, enclos): object 's' not foundcols_condense(s)#> Error in vapply(x$cols, function(xx) class(xx)[[1]], character(1)): object 's' not found