dftype.Rd
Create a new data frame which contains the type of columns and variables for the input data frame. Furthermore, if there are non-numeric columns, it will return the unique values of non-numeric columns and their length.
dftype(df)
df | Data Frame |
---|
summary Vector
unique_df Data Frame
df <- data.frame(type = (c("Air", "Ship", "Bus", "Air")), time= c(6, 32, 31, 5), origin= c("US", "Mexico", "CANADA", "UK")) results <- dftype(df) results$summary#> type time origin #> Length:4 Min. : 5.00 Length:4 #> Class :character 1st Qu.: 5.75 Class :character #> Mode :character Median :18.50 Mode :character #> Mean :18.50 #> 3rd Qu.:31.25 #> Max. :32.00results$unique_df#> column_name unique_values num_unique_values #> 1 origin US,Mexico,CANADA,UK 4 #> 2 type Air,Ship,Bus 3