Hi,
Welcome to the RStudio community!
The summary function is a generic function that generates a summary of your data based on the class of object and the type of data within. If you get different results than expected, that's likely because the object you're using has a different class.
To check the class of an object, use class()
Example:
#Data frame
myData = data.frame(x = 1:10, y = runif(10))
class(myData)
[1] "data.frame"
lapply(myData, class)
$`x`
[1] "integer"
$y
[1] "numeric"
summary(myData)
x y
Min. : 1.00 Min. :0.2182
1st Qu.: 3.25 1st Qu.:0.4429
Median : 5.50 Median :0.6601
Mean : 5.50 Mean :0.6518
3rd Qu.: 7.75 3rd Qu.:0.9208
Max. :10.00 Max. :0.9867
#Matrix
myData = list(x = 1:10, y = runif(10))
class(myData)
[1] "list"
lapply(myData, class)
$`x`
[1] "integer"
$y
[1] "numeric"
summary(myData)
Length Class Mode
x 10 -none- numeric
y 10 -none- numeric
Hope this helps,
PJ