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

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -