How to describe the data structure of a data frame in R? -
i looking way describe data structure (not data itself) of data frame in r.
df = read.csv2('data.csv') desc(df) output should
df.columnname1 df.columnname2 (type) ...
try:
df_types <- data.frame("col_types" = unlist(lapply(df, typeof))) i use lapply loop on columns getting type. output named list, use unlist convert named character vector , cast data.frame printed output in format you're after.
Comments
Post a Comment