This function provides information about a given dataframe, including the number of rows and columns, as well as the data types of the columns.
dataset_info(df, variables = NULL, info = TRUE)
A dataframe or matrix to analyze
An optional character string giving a variables for computing correlation matrix. This must be colnames from df.
Logical; if TRUE (default), prints information about the dataframe. If FALSE, only returns the information as a list.
If info
is TRUE, the function prints the information about the
dataframe and returns an invisible list containing the number of rows and
columns, and the data types of the columns. If info
is FALSE, the
function only returns the list.
library(toRpEDA)
#Getting informations about dataframe
dataset_info(mtcars)
#>
#> Informations about your dataframe:
#> Number of rows: 32
#> number of columns: 11
#>
#> Types of columns:
#> - mpg - double
#> - cyl - double
#> - disp - double
#> - hp - double
#> - drat - double
#> - wt - double
#> - qsec - double
#> - vs - double
#> - am - double
#> - gear - double
#> - carb - double
#>
#Getting number of rows in a dataframe or matrix
dataset_info(mtcars,info = FALSE)$nrow
#> [1] 32
#Selecting columns
dataset_info(mtcars, variables = c("cyl", "vs", "carb"))
#>
#> Informations about your dataframe:
#> Number of rows: 32
#> number of columns: 3
#>
#> Types of columns:
#> - cyl - double
#> - vs - double
#> - carb - double
#>