I can't view data with head()

Please ask your questions about R Markdown here.

hei <- c(1,2,3,4,5)
wei <- c(2,4,6,8,10)
df <- data.frame(wei,hei)
class(df)  # data.frame
head(df)  # no result
View(df)  # display data.frame df with another tab

How can view dataset with using head() of which data type is frame data

Your example works , including head, when I run it in a fresh session.

if you type into console


does it find for you anything other than package:utils and namespace:utils ? ...Maybe you have had your head function overidden in some way.

Thanks, I 've learned many things from your comments...
head(iris) # no result...
head(as.matrix(iris)) # can see the result... thanks

dt <- as.data.table(iris)
head(dt) # no result
I will study more thanks

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.