I want to find the mean height of participants that are present in the cystfibr package of the ISwR library. When printing the entire height data set it appears to have a 21x2 matrix with height values and a 1 or 2 to indicate sex. But, ncol returns a value of NA suggesting it is a vector. Trying to get specific indexes of the matrix (heightdata[1,]) also returns an incorrect number of dimensions error.
I'm looking, to sum up only the height values in the vector but when I tried to execute the code I get the sum of the male and female integers. (25)
install.packages("ISwR")
library(ISwR)
attach(cystfibr)
heightdata = table(height)
print(heightdata)
print(sum(heightdata))