# Example 1a: Descriptive statistics for 'mpg'
descript(mtcars$mpg)
# Example 1b: Alternative specification using the 'data' argument
descript(mpg, data = mtcars)
# Example 2: Descriptive statistics, print results with 3 digits
descript(mtcars$mpg, digits = 3)
# Example 3a: Descriptive statistics for x1, print all available statistical measures
descript(mtcars$mpg, print = "all")
# Example 3b: Descriptive statistics for x1, print default plus median
descript(mtcars$mpg, print = c("default", "med"))
# Example 4a: Descriptive statistics for 'mpg', 'cyl', and 'disp'
descript(mtcars[, c("mpg", "cyl", "disp")])
# Example 4b: Alternative specification using the 'data' argument
descript(mpg:disp, data = mtcars)
# Example 5a: Descriptive statistics, analysis by 'vs' separately
descript(mtcars[, c("mpg", "cyl", "disp")], group = mtcars$vs)
# Example 5b: Alternative specification using the 'data' argument
descript(mpg:disp, data = mtcars, group = "vs")
# Example 6: Descriptive statistics, analysis by 'vs' separately, sort by variables
descript(mtcars[, c("mpg", "cyl", "disp")], group = mtcars$vs, sort.var = TRUE)
# Example 7: Descriptive statistics, split analysis by 'am'
descript(mtcars[, c("mpg", "cyl", "disp")], split = mtcars$am)
# Example 8a: Descriptive statistics,analysis by 'vs' separately, split analysis by 'am'
descript(mtcars[, c("mpg", "cyl", "disp")], group = mtcars$vs, split = mtcars$am)
# Example 8b: Alternative specification using the 'data' argument
descript(mpg:disp, data = mtcars, group = "vs", split = "am")
if (FALSE) {
# Example 11a: Write results into a text file
descript(mtcars[, c("mpg", "cyl", "disp")], write = "Descript.txt")
# Example 11b: Write results into an Excel file
descript(mtcars[, c("mpg", "cyl", "disp")], write = "Descript.xlsx")
result <- descript(mtcars[, c("mpg", "cyl", "disp")], output = FALSE)
write.result(result, "Descript.xlsx")
}
Run the code above in your browser using DataLab